I have read Links in dropdown options and using href links inside tag and several other questions in SO, however my question is a bit different.
I would like to have BOTH text AND href inside a select combo-box. Something like
<select id="mySelect">
<option value="-1" selected>choose an option to test</option>
<option value="1">Book 1 <a href="http://example.com/23?id=12">open site</a></option>
<option value="2">Book 2 <a href="http://example.com/11?id=10">open site</a></option>
</select>
The idea is that the user can select from a combo-box, but also can go to an external site by clicking open site
to view the Books before selecting them.
ie: clicking on the left-side of the
<option>
is a regular select, while clicking on the right-side of the <option>
will send the user to another page
Is that possible? Running the code either ignores completely the href or complains Warning: validateDOMNesting(...): <a> cannot appear as a child of <option>.