Questions tagged as 'javascript'

2
answers

Change the color of a word in a textarea still in edition

How do I make it every time the browser finds a "reserved word" in textarea , it automatically changes its color. I want to know to make a syntax highlighting.     
asked by 18.10.2017 / 00:47
2
answers

Regular expression to capture after the last bar

I have the following URL: ("file:///home/pasta/pasta/img/intro-bg.jpg") I'd like to know what regular expression I can use to catch only intro-bg.jpg If anyone can help me, thank you.     
asked by 25.10.2017 / 20:13
2
answers

Is it possible to change the name of a JSON position using JavaScript or jQuery?

I have this JSON: [{ id: 1, total: 50.00 }, { id: 2, total: 70.00 }] I would like to know if it is possible to change the name of 'total' to 'price' using JavaScript or jQuery?     
asked by 16.11.2017 / 16:28
2
answers

Get value other than null javascript

I have a function in Javascript, and every time I put it in the function, I want it not to enter if the value has null, because it is giving error. It only needs to get in the function if attachment is other than null. Here's how I'm doing:...
asked by 20.07.2017 / 17:15
2
answers

How to not print the line break using console.log

I'm developing a program in Javascript where I have to sort an array, but I'm having a problem printing this array. I need to print everything in a row, with a space between the elements, and no space at the end, but if I use the console.log...
asked by 03.08.2018 / 00:38
2
answers

Best way to dynamically generate a li with pure javascript

Hello, I have the following structure <li class="col-md-4"> <figure> <a class="list" href="#"><img alt="" src="image.png"></a> <div class="color"> <small>teste</small> <...
asked by 11.06.2018 / 22:12
1
answer

How to make an input does not accept the term "Brazilian Music"

That is, if you typed "Brazilian Music" inside the imput it gives an error and does not accept. Example. Whenyouhave"Brazilian Music" it will not go on .. HOW DO YOU DO IT? MY CODE: <!DOCTYPE html> <html> <...
asked by 21.06.2018 / 23:53
3
answers

How to move to the next input using javascript?

I made a form in HTML but I wanted it when a user hit ENTER to go to the next field. Example, the first field has to fill in with the name, when the person pressed ENTER it would go to the low (user) option and so on. <div cla...
asked by 20.06.2018 / 14:00
3
answers

Concatenate elements

I'm having trouble concatenating the elements below. I have the valorID variable that is used as an id in the div, and I'm trying to insert it in the id attribute and valorPosicao for the left attribute of the inline css. H...
asked by 05.07.2018 / 22:21
3
answers

Get the attribute of several div's and send one at a time to another function

I'm trying to get the attribute of each div and send one at a time, but it's giving error, the code I tried to do and this: function deletarTudo() { var lista = document.querySelectorAll("#lista div").getAttribute("id"); for (var i =...
asked by 15.06.2018 / 20:02