184
rated 0 times
[
190]
[
6]
/ answers: 1 / hits: 17639
/ 11 Years ago, tue, november 26, 2013, 12:00:00
Javascript, Jquery, HTML
I am adding select options to a select box dynamically. I take each unique element in an array and add it as an option to the select element. It works great, but I need to add a title attribute at the same time, with the same value as the option text. The end goal of this is to make tooltips for each option.
So instead of <option>value</option>
, it looks like
<option title=value>value</option>
Does that make sense?
Current HTML:
<select id=Process_Issue class=fieldLabel2 IncidentInputField dynamicFields1></select>
JS:
$.each(eliminateDuplicates(aryProcess), function (key, value) { $('#Process_Issue').append($(<option/>, { text: cleanNulls(value) })); });
More From » jquery