How to call a html page to a button click

Let us say i have

<form id="editFirst" action="editFirst.html" method="POST">

I want to call by this button below Let me know how that can achieved

<input type="button" value="Main "  class="Rights">

Thank you
roy_sanuAsked:
Who is Participating?
 
Marco GasiConnect With a Mentor FreelancerCommented:
If you're using jQuery, you can simple add a listener:

<input id="editFirstButton" type="button" value="Main "  class="Rights">

$(document).ready(function(){
    $('#editFirstButton').on('click', function(){
        window.location.href('your_page.html');
    });
}); //end jquery

Open in new window

0
 
Pratima PharandeCommented:
not able tp copy jabascript function here
0
 
Pratima PharandeCommented:
Create one Javascript function and type this

window.location.href = "http://www.google.com";
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
chaitu chaituCommented:
function clickRights()
{
  document.forms[0].submit();
}

<form id="editFirst" action="editFirst.html" method="POST">



<input type="button" value="Main "  class="Rights" onClick='clickRights()'>

Open in new window

0
 
Rajiv Lochan PadhiSoftware ProgrammerCommented:
<input type="button" value="Main "  onclick="location.href='editFirst.html';" class="Rights">

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.