In my jsp page, I have one button and one label. When page loading, the text of the label box is “Test”. Suppose, user clicks the button then I have to change the text of the label into “tested”.
I am new to Jsp.So, Please guide me to get out of this issue…
You would first need to set a listener to your button, say our markup was as follows:
We can select the button element, and set it’s onclick attribute:
Then we can define a function call
testthat will toggle the label:And that’s it!
Here’s a jsfiddle demonstrating this code.