button with onclick funtion code example
Example: html js button onclick
// In HTML:
// <button id="buttonID" onclick="yourJSFunction()">Text</button>
// In JavaScript:
function yourJSFunction() {
// Do stuff
}
// In HTML:
// <button id="buttonID" onclick="yourJSFunction()">Text</button>
// In JavaScript:
function yourJSFunction() {
// Do stuff
}