Questions tagged as 'javascript'

1
answer

I can not change the contents of my button

I'm trying to change the text of my button when I click on it, but I'm not getting it. My code: function altera(argument) { document.getElementById('novo').innerHTML="atualizou"; } <!DOCTYPE html> <html> <head&...
asked by 27.10.2018 / 17:13
3
answers

Option appearing in textarea separated by commas / lines

I'm trying to make a small form based on simple HTML, CSS and JavaScript (without JQuery). In one of the parts of this form, I would like any option selected of a select to appear in the comma% separated by commas or lines. In a...
asked by 02.11.2018 / 01:04
1
answer

Get the value of 'radio' with javascript

I'm trying to get the value of input radio , but if I do: document.querySelector('input[name="group1"]:checked').value; It returns me " ON ". Does anyone know what can it be? I was expecting it to return me Red , Yellow o...
asked by 05.11.2018 / 15:09
1
answer

html javascript list json data in ul li [closed]

Staff ask for help from friends: The code makes an ajax request to take data from an api (json) and go through all objects inside the array    My json = [{Name: "Ajato 2000"}, {Name: "Crystal I"}] In the case how do I list or print the...
asked by 27.11.2018 / 03:51
2
answers

update div with checkbox value checked

const inputs = [...document.querySelectorAll("input[class='serv']")]; const res = document.getElementById("resultado"); const total = res.querySelector('[name="total"]'); const nomes = res.querySelector('[name="nomes"]'); inputs.forEach...
asked by 01.12.2018 / 05:34
1
answer

Modal feedback on signup screen [closed]

Good evening! I have a question regarding the work of my faculty regarding modal feedback. I have already done all the code in both html and javascript (I put the alert to see if it was working right), but I would like to change alert for the mo...
asked by 29.11.2018 / 02:29
1
answer

Javascript in several html's

I am learning and using JavaScript and would like to know if it is possible to use scripts from a .js file in several other .html files, with functions and everything else. If it is possible, just call the .js file in .html by the tag <scr...
asked by 18.09.2018 / 18:34
1
answer

What is the difference between setAttibute, getAttribute and hasAttribute?

hasAttribute is the evolution of getAttribute and setAttibute ? I am learning JavaScript but I am in doubt about what each one does, getAttribute I know it takes an attribute, seAttribute I know that arrow an at...
asked by 22.09.2018 / 03:11
2
answers

Is it possible to permanently change the style of a CSS class using Javascript?

I have the following code snippet: $("#mudarcss").click(function(){ $(".teste").css("background-color", "blue"); }); $("#adicionardiv").click(function(){ $("#conteudo").append("<div class='teste'>Minha Div 2</div>");...
asked by 26.07.2016 / 19:22
1
answer

How to get the ID of an element inside a div?

I have a div and some images, each image represents an item in a global array . When I drag this image to% editing% an editing form is enabled, otherwise a form is enabled to create new rule and generate a new image. I need to know wh...
asked by 05.02.2015 / 17:45