-2

I wanna check button value in java script(mvc),here is mycode:

            <span>
            <input type="button" value='@L("Follow")'  onclick='return   follow(this)' />
        </span>

and in my js:

function follow(btn) {
if ($(btn).defaultvalue == "Follow") {
}
3
  • 1
    Possible duplicate of stackoverflow.com/questions/13132252/… Commented May 14, 2015 at 14:36
  • 2
    JS is case sensitive. It'd be defaultValue. Commented May 14, 2015 at 14:38
  • @MarcB: it works!TNX Commented May 14, 2015 at 14:59

1 Answer 1

0

Jquery

function follow() {
  var buttonVal = $('button').val();
 // do your check 
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.