For some reason, I can\'t get this to work.
My options list is populated dynamically using these scripts:
function addOption(selectId, value, text, sele
Your syntax is wrong.
You need to call attr with two parameters, like this:
$('.salesperson', newOption).attr('defaultSelected', "selected");
Your current code assigns the value "selected"
to the variable defaultSelected
, then passes that value to the attr
function, which will then return the value of the selected
attribute.