I've multiple buttons with related text to each button, when user click on the button, the text should change according to button and text should be displayed in the DIV.
I'm using if elseif to choose between the text for each button, now I'm unable to go through the function to pass the text to the div onclick().
<html>
<head>
function display (selected) {
if (decision == firstbox) {
display = "the text related to first box should be displayed";
} else if (decision == secondbox) {
display = "Text related to 2nd box.";
} else {
display ="blank";
}
</head>
<body>
<input type="button" id="firstbox" value= "firstbox" onclick="display(firstbox)" /><br>
<input type="button" id="secondbox" value= "secondbox" onclick="display(firstbox)" /><br>
</body>
</html>