-5

I have a dropdownlist in my view which consists of true and false. But I am storing one more value which I need to pass to controller.

@Html.DropDownListFor(x => x.DropDown, Model.DropDown, new {Id  = "DropDown,@Text="782});



$('#DropDown').change(function() {

    var y = $(this).val();
    alert(y);

});

Currently I have a jquery dropdownchange function to get true or false.

But how can I get this @text value in jquery function?

1

1 Answer 1

0

Try using option:selected

 var y = $(this).find('option:selected').text();
 alert(y);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.