Questions tagged as 'javascript'

2
answers

How to change one variable without changing the other?

When I copy a variable, if I change the copy, I change the first variable accordingly. How to change the value of the second without affecting the first? var cont = [10, 1, 3]; alert(cont.length + "\n"); var tmp_cont = cont; tmp_c...
asked by 05.03.2016 / 02:44
2
answers

Change label class (icon-font) with click

I'm using iconfonts in a drop-down menu, where the link looks like this: <li class="abre-dropdown"><a href="javascript:void(0)"><label style="float:left;" class="icon-location"></label>Nossa casa<label class="icon-do...
asked by 05.01.2016 / 17:17
1
answer

How to generate a "token" in the link bar with javascript?

I would like to know if you can generate random characters in the link on a page, without having to change the address of the link. For example, when the person clicks the link, it will be sent to: site.com/pages/pagina-de-destino.html B...
asked by 08.01.2016 / 06:17
1
answer

How to create a color palette and color a div depending on the chosen color [closed]

Where do I find content to create a website with a color palette to customize a product? For example: You click on a color and this color applies to the product, I click on another color and change the color I had previously chosen. And wh...
asked by 07.11.2016 / 03:23
2
answers

How to enable onclick after a jquery? [duplicate]

I have botões that are mounted dynamically via jquery , it happens that on the main page I have events of these botões , but since they do not exist yet at the time of loading the page the events are not loaded, I needed do...
asked by 04.11.2016 / 14:44
1
answer

Accordion without jQuery

I have the following accordion, but I wanted it to click on one, the other one that was open, closed .. always keep only one asset. How do I? <!DOCTYPE html> <html> <head> <style> button.accordion { background-color...
asked by 15.11.2016 / 15:33
1
answer

Get value from a specific input using AJAX

Next, I have a form that will be sent with AJAX, however the URL will vary according to the ID, eg: site.com/ajax/remove/100 <- ID site.com/ajax/remove/200 <- ID This value of the ID is in a hidden field of the form, how can I get thi...
asked by 15.11.2016 / 00:28
3
answers

OnMouseOver Effect

I wanted two effects in OnMouseOver so that when you mouse over, the text is one color and the background is another color. I'm using this code onmouseover="javascript: this.style.backgroundColor = 'Red'" But in this case it just changes th...
asked by 12.11.2016 / 00:59
2
answers

Regex remove some elements of the style attribute

I need to keep only some properties of the style attribute in tags present in a string of an html document, they will be placed in a whitelist, everything else will be removed. In the example below: <TD class=xl76 style="BORDER-TOP: windowt...
asked by 22.06.2016 / 20:15
1
answer

Is there a way to insert events in the html element at runtime?

Imagine a page with a single input text, that is, a text field in the HTML document like this: <input value="digite aqui" type="text" id="el"/> . But I want to insert the events onBlur() and onFocus() into t...
asked by 02.07.2016 / 10:17