单击按钮更改下拉列表值

时间:2014-02-13 07:11:05

标签: javascript jquery drop-down-menu href

<apex:selectList value="{!operator}" size="1" id="operator123" >
            <apex:selectOption itemValue="=" itemLabel="Equal" id="teja123" />
            <apex:selectOption itemValue="!=" itemLabel="Not Equal To"/>
            <apex:selectOption itemValue="<=" itemLabel="Less Or Equal"/>
            <apex:selectOption itemValue=">=" itemLabel="Greater Or Equal"/>
            <apex:selectOption itemValue=">" itemLabel="Greater Than"/>
            <apex:selectOption itemValue="<" itemLabel="Less Than"/>
            <apex:selectOption itemValue="Like" itemLabel="Like"/>
        </apex:selectList>

<b><a href="#" onClick="clearValue()" > New Search </a> </b>

单击新搜索我想将下拉值更改为等于

我试过这种方式,但它无法正常工作

<script>
function clearValue() {
document.getElementById('{!$Component.page1:form1:operator123:teja123}').value='equal';
}           
</script>

1 个答案:

答案 0 :(得分:0)

我认为你应该使用“=”而不是“相等”

function clearValue() {         
document.getElementById("operator123").value = "=";
}
相关问题