I have a button like this:
<input type="button" name="btn" id="btn" value="Proceed"/>
After all processes and get the expected result, I need to apply some changes on this button.
I know I can do the first goal using the code below:
$('#btn').attr('value','newValue');
But for the second one, I need something like our previous codes in JavaScript as below:
onclick="window.location.href='newPage.htm'";
Help me please.
something like, if I understand you correctly:
$("#btn").val("newValue").click(function(){
document.location = "newPage.htm";
});
This will set a new value and bind a click handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With