I am looking for a way to change a parameter value from a select tag when users click on a link.
For example, I have an html selection option:
<select> <option value="0">Please Select</option>
<option value="1">red</option>
<option value="2">white</option>
</select>
And I have 2 links. <a href="#" title="red" class="preview_link">red</a> <a href="#" title="white">white</a>
When the user clicks red, the option switches to red, and white switches to white. I am using the following code, but it does not work.
jQuery("a.preview_link").click(function() {
var title = jQuery(this).attr("title");
jQuery(this).parent('p').children("select :selected").text(title);
});
Any suggestions?
user381800
source
share