$select->find('option')->removeAttr('selected'); removes all the selected attributes for the currently selected $select (<select>) but I am unable to set selected for an option
I have tried:
$option->attr('selected',true) does not appear to work. It adds the selected attribute on the current $option but sets it to empty string.
I have also tried :
$option->attr('selected',"selected") but it makes no difference.
Using DOMDocument I can do the following:
$childNode->setAttribute('selected', 'selected');
but I can't find an equivalent option in queryPath.
Can anyone help?