Answers for "button click action in html"

13

javascript onclick

var myElem = document.getElementByID('ElemID');
myElem.onclick = function() {
	//do stuff
}
Posted by: Guest on February-10-2020
0

html button action

A form with two submit buttons. The first submit button submits the form data to "submit_data.php", and the second submits to "send_data.php":

<form action="/submit_data.php" method="get">
  <label>Name:</label>
  <input type="text" id="uname" name="uname"><br><br>
  <label>Age:</label>
  <input type="text" id="uage" name="uage"><br><br>
  <label>Address:</label>
  <input type="text" id="uaddress" name="uaddress"><br><br>
  <button type="submit">Submit</button>
  <button type="submit" formaction="/send_data.php">Submit to another page</button>
</form>
Posted by: Guest on April-23-2020
0

calling function on click html

<img src="hospital.png" id="hospitals" onclick="damarkers();">
Posted by: Guest on June-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language