How to send value from Expression Language to Javascript?

I use Struts 1.3, JSTL, jQuery 2.x,
I try to pass value from EL to Javascript, to set default value for drop-down list:

$("#provinceId").val('${estateProfileDTO.provinceId}');

(not work)

$("#provinceId").val('582');

(it works, but I must set value from ${estateProfileDTO.provinceId}, not static value. )

<div class="large-8 columns">
    <s:select property="provinceId" styleId="provinceId">
        <s:option value=""></s:option>
        <s:options collection="listProvince" property="provinceId" labelProperty="name"/>
    </s:select>

    <script>                                   
        $("#provinceId").val('${estateProfileDTO.provinceId}');
    </script>
</div>  


Source: jsp

Leave a Reply