[jQuery] How to add 'selected' to option of dynamically set Select input?

2010-01-31 Thread KansasCoder
I've been using the following to display the statename in my dropdown: $('#State option[value="' + LocationObject.State + '"]').attr('selected', 'selected'); LocationObject is a json object that I am using. The problem with this is that it does not add 'selected' to the opt

[jQuery] How to get the inline value for 'Display' style property via jquery/js??

2009-03-26 Thread KansasCoder
I have an inline css attribute which is set in the codebehind but changes dynamically in the browser via jquery. The display of a textbox and a couple of dropdowns are altered formblock to none based on some rules. When I view the source of the page the dropdown that is visible still has the ori