Questions tagged as 'javascript'

2
answers

How to add variable to array [JS]

I have the following code: var newLat = markerElem.getAttribute('lat'); var newLng = markerElem.getAttribute('lng'); var locations = [ {lat: newLat, lng: newLng} ] I want to get the values of the variables newLat and newLng...
asked by 29.06.2018 / 15:55
1
answer

How to upload an image through the clipboard (copy and paste)?

I was taking a look at the functionality of Imgur site. When you make a printscreen or even copy an image (not the link, but the image, which is an option that is available in most current browsers) and then paste on the page, the image that w...
asked by 09.01.2018 / 14:27
2
answers

How do I get this effect in a progress bar?

How to make this effect in the text inside the progress bar where the text changes color according to the fill of the bar, and when the bar reaches the text, only a part of the text changes color? Noticethatwhenyou'rein50%halfthetextcolortur...
asked by 10.01.2018 / 22:34
2
answers

remove checked from input radio

How can I remove checked input radio if a div has the click effect? <!DOCTYPE html> <html> <body> <form action=""> <input type="radio" name="gender" value="male"> Male<br> <input type="radio" name="g...
asked by 09.01.2018 / 18:32
1
answer

I have a Javascript function that works in Chrome but not in Firefox

I have a javascript function that does not let you write numbers, only letters, in chrome it works exactly as it is proposed, now in mozilla it does not work, below my function: function soletra(event) { var value = String.fromCharCode(eve...
asked by 10.01.2018 / 11:31
2
answers

I can not filter the array objects using Filter

I'm trying to return the objects according to the id of the genres but an empty array is being returned var filmes = [ { title: 'Primeiro Filme', genres: [ { id: 10 }, { id: 15 }, {...
asked by 18.01.2018 / 13:39
2
answers

Shred string into random parts

I need a JS script that breaks any string into random parts, say I have a string: x = "Deliciosogostoeobomgostodasnuvensseremfeitasdealgodao" and after it has been inserted into the script, it can be returned like this: "Del icios ogos t...
asked by 19.02.2018 / 03:15
3
answers

Why does parseInt return NaN?

I have this code: function aparecer() { const elemento1 = document.getElementById('numero').value; const elemento2 = parseInt(elemento1); alert(elemento2) } <html> <body> <button onClick="aparecer()"> A...
asked by 18.02.2018 / 19:07
2
answers

How to make an input to accept only letters?

I am making a form and the user has to type only letters in the field of his name, I want to block him to type some other type of character ah not be the letters, how do I? I am programming with HTML5 and CSS 3. The form will be WEB.     
asked by 15.07.2016 / 20:53
2
answers

Sending an image and other data via JQuery to PHP

I have a question that I can not find a solution to. I need to send via Ajax an image and other fields to a PHP file and save it to MYSQL database. I do not know how I can do this, can anyone give me an idea of what JQuery looks like?     
asked by 27.07.2016 / 03:02