Linked Questions
11 questions linked to/from How to call a JS function using OnClick event
617 votes
7 answers
208k views
Why does jQuery or a DOM method such as getElementById not find the element placed later in markup?
What are the possible reasons for document.getElementById, $("#id") or any other DOM method / jQuery selector not finding the elements? Example problems include: jQuery silently failing to ...
-1 votes
2 answers
220 views
I am trying to make an alert pop up when I click on the picture [duplicate]
I am trying to make it so when you click on each image in the html you recieve an alert telling you what each picture is. <html lang="en"> <head> <title>Task 2</title>...
2 votes
3 answers
2k views
Javascript - Calling a function for an onClick event
Consider the following code : <html> <head> </head> <body> <script> function showAlert (text) { alert(text); } x = document....
-1 votes
4 answers
7k views
document.getElementsByClassName().onclick with dynamic elements
I am creating a Javascript program where I would like to make styling changes to an element by its class name. There are multiple elements with this class name but I want to target the one that is ...
0 votes
1 answer
1k views
How can I reverse the order of div elements upside down on 'onclick'?
I have the following code: <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>StackOverflow Question</title> <style> ....
0 votes
1 answer
173 views
How to make a ball bounce again on click, even while in midair?
I need to make a game where a ball drops and cannot hit the floor, and you have to make it bounce again before it hits the ground, but I don't know how to make the ball jump when the mouse clicks! ...
-3 votes
2 answers
132 views
Error onclick button code wrong?
I have an onclick on a button but it is not working properly. <a href="javascript:void(0)" class="button" onclick=\'websiteopen("'.$site->page_id.'","fb"), PopupCenter("http://nullrefer.com/?'.$...
-2 votes
1 answer
97 views
Change CONFIG [CLIENT SIDE] in Tampermonkey [duplicate]
CONFIG.PNG <-- How to change the Config in Tampermonkey if i change it there it works but i want to do it in Tampermonkey does that work and how?
1 vote
1 answer
109 views
Run JavaScript after event instead automatically
I am pretty new to JavaScript and have been busting my brains as to why this won't work. I have read and tried many posts (mainly this one, this one, this one and this one) but none have solved my ...
-4 votes
1 answer
104 views
Is "choose" a reserved keyword in JavaScript?
I'll explain myself: I'm building a simple web, and at some point in the HTML I have this <button id="choose" type="button" onclick="choose()">Choose</button> ...
-1 votes
1 answer
36 views
Apend Query String Parameter
I have a query string (example) ?something=1&something=3 I want to find and then add these parameters to a new URL and goto that URL on button click event. I can find the query string using var x =...