I am using a button on my form. How do I link to another web page/file when clicking on that link? Here is the code I tried, but does not work.
<button class="btn" data-bind="click: function() { document.location.href=$(this).attr('RiskAssessmentMain.aspx'); }">back</button>
set the url you want to go in <form>
action attribute.
then use a submit
instead of button
.
Here is an example.:
<form action="http://google.com">
<input type="submit" value="Google">
</form>
<input type='button'value='back' class="btn" onclick="document.location.href='RiskAssessmentMain.aspx';"/>
Try it: http://jsfiddle.net/wzy4B/
You Can try this one
<script>
function open_win() {
window.open("http://www.google.com")
}
</script>
Or you can also Do it like this
<script>
function openWin() {
myWindow=window.open('','','width=200,height=100');
myWindow.document.write("<p>This is 'myWindow'</p>");
myWindow.focus();
}
</script>
<input type="button" value="Open window" onclick="openWin()" />
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