Questions tagged as 'javascript'

4
answers

As a tag on an element of a table with jQuery?

I have a simple table: table { border-collapse: collapse; } table tr td { border: 1px solid #000; } mark { background: yellow; } <table width="300px" border="1px" bordercolor="#FF0000"> <tbody id="qtdPrecos"&...
asked by 26.07.2017 / 13:59
2
answers

How to prevent the user from making changes in the input?

I have input in a form, but it should not have its value changed: <input type="text" name="pais" value=""> How can I prevent the value from being changed? <!DOCTYPE html> <html> <body> <form action="/act...
asked by 17.11.2017 / 17:31
3
answers

What is the correct way to concatenate strings in JavaScript?

I started learning Python and was told I should not concatenate the strings with , but use the .format() method. And in JavaScript is it correct to use + or , to concatenate strings or is there a more recommended and...
asked by 23.08.2017 / 01:18
2
answers

Handle JavaScript window.history

Is there any way to list the URL's of window.history ? If I want to use window.history.go(-2) , can you know which URL this -2 will return?     
asked by 17.08.2016 / 20:01
2
answers

How to avoid very great victory condition in the old woman's game?

I made a game of the old one that verifies the conditions of victory of the user with if , however I did not find an elegant solution. I am trying to develop a method to check the win condition with array , however I am not succeeding, fo...
asked by 16.11.2016 / 22:48
2
answers

GroupBy in Javascript

I'm getting the following result from a query: [ { "disciplina": "Portugues", "periodo": "1º Bimestre", "tipo": "1ª avaliacao", "valor": 9.5 }, {...
asked by 04.02.2017 / 01:32
2
answers

IF to check quantity required for given KG

I need to make an IF in Javascript. I'll explain: A customer sells: 40kg barrels. 3kg tube. I'm not sure how to do this IF. The idea is to show in the field qtd40kg Only multiples of 40, which is the weight, ie: If I need 4...
asked by 16.01.2016 / 23:55
6
answers

Convert div text to number

I'm trying to get the text from this structure: <span id="our_price_display">R$ 71,90</span> And I would like it to return only 71,90 . But in the structure I created, I can not get the "R $" from the text and only reco...
asked by 24.11.2016 / 19:44
2
answers

Input of type "text" similar to the system of tags of the Stack Overflow

How to make a input of type text to use in a form that I need to add tags, just as it exists in Stack Overflow ?    Note       Whoever responds, the answer can be extremely large if it is to quote   the server-side ren...
asked by 11.01.2016 / 02:32
3
answers

Uncheck a checkbox when clicking outside it

HowcanIunmarkacheckboxifIclickonanotherfieldinthesite?Thecheckboxissothatwhenthestateischecked,it'drags'mymenufrom-65%to0andappearsonthescreen,beingusedinaresponsivemobilelayout.UnfortunatelyIhavenoideahowthiscanbedone,butIbelieveit'sinjavascri...
asked by 29.12.2015 / 18:43