Questions tagged as 'javascript'

1
answer

.test () (js) equivalent in php

In JavaScript, we have the function test() , for example: /Test \[(\d+)\]/gi.test(string); // Pode retornar true ou false. Does php have a similar function?     
asked by 31.12.2017 / 21:52
2
answers

Knowing which div contains a specific class in jquery / javascript

I need to know the amount of divs that contain a specific class, I thought of looking for all the css I have in the divs, so I'll eliminate it until I find the divs with "has-error", but I can not find who exactly has it a class "has-error" H...
asked by 03.05.2018 / 19:37
3
answers

Generate number counting when clicking

Is there any way that when I click on an element, update the number of tag to a higher value? Ex: The value of the tag default is 1 , the tag n , n="1" when clicking on the element updates to n="2" and...
asked by 03.01.2018 / 23:30
1
answer

Customize .tofixed to use comma as decimal separator

I need to make .tofixed(2) work with commas and not with dot as a decimal separator. In case, when I calculate the final result is "501.60" and the certain would be "501.60". document.getElementById('resultado'+tipo+'_'+index).value...
asked by 21.12.2017 / 10:44
1
answer

How do I get the value of a list of ckeckboxes with jquery?

I've tried the following: <input name="chklista" id="chk01" value="01" type="checkbox" />01<br /> <input name="chklista" id="chk02" value="02" type="checkbox" />02<br /> <input name="chklista" id="chk03" value="03" t...
asked by 18.12.2014 / 15:11
2
answers

Trigger event to change slider image by clicking the directional arrows on the keyboard

I'm using a jQuery slider, but I would like to improve it in Accessibility . I would like the keyboard arrows ← and right → to navigate my slider similarly to the click navigation arrows. But I would also like that when pressing the dire...
asked by 17.11.2014 / 05:23
2
answers

How to activate a function by an attribute?

Imagine a code: <div id='teste' data-conteudo="funcao()"></div> I want to get the attribute "% cc" from the "function ()" function to be triggered, as if it were a value of the onclick attribute.     
asked by 02.03.2018 / 01:53
2
answers

How to add css to all elements whose id contains "..."?

I have several elements whose id contain, for example "elem", can be "% elem" or "elem%", can have characters before the String elem as before or before and then ("% elem%"). And I would like to add all the elements that css with jQuery. How ca...
asked by 21.02.2018 / 11:54
3
answers

Add automatic option each passing month

I have a payment system, which has a select that displays the months since the system started, follows the code below: <select name="situacao"> <option>Fevereiro/2018</option> <option>Janeiro/2018</option>...
asked by 21.02.2018 / 18:57
1
answer

Picking positions of a word within a text

I have text and want to get the initial positions of a specific word in all occurrences within that text. For example, I have the following text: maria gosta de joão. jose gosta de maria. maria gosta de joao e jose. Note that the word " mar...
asked by 16.02.2018 / 19:20