Questions tagged as 'javascript-eventos'

1
answer

Input mask when loading page

I have a page that displays some user information. One of the fields is the telephone field. I want to apply a mask in this field when loading the page. I can even put the mask on, but only on the onKeyUp event. The problem is that the mask only...
asked by 21.08.2017 / 02:18
1
answer

Doubt in an onclick Javascript event

I have this javascript code to add and remove the added lines. function adicionar() { var itm = document.getElementById("itens").getElementsByClassName("div-bloco-form")[0]; var cln = itm.cloneNode(true); var inputs = cln.getElemen...
asked by 27.04.2017 / 16:39
1
answer

Problem with running EventListener

if((document.getElementById("avatarZica").innerHTML == "")){ document.getElementById("avatarLegal").addEventListener("click", function(){ document.getElementById("avatarZica").innerHTML = "<canvas class='emscripten' id='can...
asked by 20.03.2017 / 20:31
1
answer

what is the difference of this, event.target and event.currentTarget in the scope of an event?

What is the difference between this, event.target and event.currentTarget in the scope of an event? var elem = document.getElementById("meuId"); elem.addEventListener("click", function (event) { console.log(this.id, event.target.id, ev...
asked by 26.10.2016 / 17:06
1
answer

Why is the code not working?

I want to, by means of a pure and simple script ), to alert after the click on a given link (from the " exit ") the following: "You are leaving the site". My script looks like this: window.document.querySelectorAll('.**sair**').oncli...
asked by 19.06.2015 / 23:25
1
answer

setTimeout and clearTimeout giving error

I'm having problems with this Script, initially its purpose is to just show the controls while the mouse moves or clicks on the div, and when it stops moving it hides the controls after a while, it works normally, but after a few more uses it st...
asked by 09.05.2018 / 02:41
0
answers

How to get the sense of the device using gyroscope and accelerometer? Ionic 3

I'm developing an application on Ionic 3, where I need to know what direction the user's cell phone is pointing to, and then make decision-making. I was trying to use the Device Orientation plugin, which returns a value in degrees (0 - 360) wher...
asked by 14.05.2018 / 05:17
1
answer

Export CSV data via JS

I have a data set in the database in my back end , and I need to create a button on which the user will click to export this data in CSV format. But I've never done this kind of event in JS. Can anyone help me?     
asked by 14.12.2017 / 21:44
1
answer

setCustomValidity does not work with Ajax

In a field change event I try to validate a user name through an Ajax call. Apparently html5's setCustomValidity does not work with jQuery. I ask for help for those who handle javascript. $("#entrada_usuario").blur(function () { var obj...
asked by 13.07.2017 / 00:00
2
answers

Input created in JS with autocomplete of JQuery UI

Hello I'm having a problem here when I create an input dynamically and it should work in jquery widgets autocomplete ui. I have seen several forums and they show how to make it work, however my problem is that the function that creates the input...
asked by 03.08.2017 / 20:33