Questions tagged as 'javascript'

1
answer

How to change the class of a component in Html using Javascript?

I wanted to know how to change the class of an html div in JavaScript <div id="showmodal" class="modal fade" id="myModal"> I want to change the name class="modal fade" to "modal fade in" in javascript, thank you for the attention!...
asked by 11.04.2018 / 13:38
3
answers

Conditionals with if and else

I have two buttons, one is Major and the other is Minor to return the following: I have two fields where I type a value in each. The first (larger) button has to return me which of the two numbers is the largest and the second button has...
asked by 09.04.2018 / 21:13
2
answers

Countless if and else conditions

I have 5 inputs where I should put any number and two buttons, one with the largest name and the other with the smaller name. I need to click on the larger button to tell me the field where the largest number is entered and when I click on the "...
asked by 10.04.2018 / 02:20
1
answer

Compare different div attributes of the same html file

my question is: I have a div with a checkbox and another one with an image, I would like that after the user tags the div with checkbox and click on a commit button, my function in js would check if the checkbox is checked and if it is it compar...
asked by 08.04.2018 / 19:14
2
answers

Get an html and save in variable

I have a simple html in file and I want to ghetto it in a variable to use, I did the get like this: let popup = ''; $.get( "popup.html", function( data ) { // the contents is now in the variable data console.log("data"+data);...
asked by 09.03.2018 / 18:06
2
answers

Click on a link and display the value within an input

Hello, someone knows how I could do this, I have 10 links, each link corresponds to an element type link 1 = :D, link 2 = :S, link 3 = :$ and so on, so I have a input type="text" name="mensagem" placeholder="digite sua mensagem..."/>...
asked by 13.03.2018 / 17:54
4
answers

How to create a clickable div? [closed]

I have a div on my site and want to make it clickable through Javascript. How do I do that? Thank you.     
asked by 13.03.2018 / 16:58
1
answer

How to refresh the page and execute a javascript function

I want when the page is refreshed, perform a function when opening             When executing this reload open the page with the next code: ---------------Executou para dar reload------------ window.location.href = '2.php'; -...
asked by 09.05.2018 / 21:06
1
answer

Position focus on a modal window field - JavaScript and Asp.net MVC

I have a view model that has a block that opens modal windows for CRUD actions. I have 4 partial viewls: create, delete, details and edit ... All in common have the field Description (Description). I need to make sure that whenever the modal win...
asked by 11.05.2018 / 00:26
1
answer

Real size auto fit of the select via option available

I usually search and do not disturb the patience of the members here, but this time I specifically need an example. See: <!DOCTYPE html> <html> <body> <select id="lista" size="4"> <option value="A">...
asked by 10.05.2018 / 03:48