Hacking the MvcHtmlString

I have an unknown problem setting the default value in a SelectList, when using DropDownListFor() with Razor. SO I was thinking about using jQuery to insert that attribute: Selected='true' at least until I found the source of my problem.

I know the name of the text for the list item, "Name of first pet?"

What's the jQuery I need to grab the list item and insert a new attribute? Or, if you have a better idea to set the default value of a drop down, I'd love to hear it.

newbiewebSr. Software EngineerAsked:
Who is Participating?
effxConnect With a Mentor Commented:
effxConnect With a Mentor Commented:
newbiewebSr. Software EngineerAuthor Commented:
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.