Javascript examples for DOM HTML Element:Input Button
Pass <button> element object into click event handler function
<html lang="en"> <head></head> <body translate="no"> <button onclick="confirmDelete(this)" value="True" name="deleteButton">Delete </button> <script> function confirmDelete(elem) { var theValue = elem.value;/* www .jav a 2s. c o m*/ if (theValue == "True") { console.log("True"); } else { console.log("False"); } } </script> </body> </html>