如何取option自定义属性?
1.SELECT代码:
<select name="zcdq" id="zcdq" class="easyui-validatebox" onchange = "setShq(this)" required="true" >
<#if GSDJJGList??>
<#if (GSDJJGList?size > 0)>
<#list GSDJJGList as data2>
<option value="${data2.val?if_exists}" parentcode="${data2.parentcode?if_exists}"
<#if data.zcdq??><#if data2.val==data.zcdq?string>selected='true'</#if></#if>>
${data2.name?if_exists} ${data2.parentcode?if_exists}
</option>
</#list>
</#if>
</#if>
</select>
2.方法:
function setShq(id){
alert($(id).find("option:selected").attr("parentcode"));
}