我想在点击特定链接时更改焦点

时间:2016-07-29 06:33:11

标签: javascript

这是我的HTML代码

<c:if test="${facetList[4] == false}">
  <div class="facet_more_section" id="moresection_<c:out value='${facetSection}' escapeXml='false'/>">
    <ul id="more_<c:out value='${facetSection}' escapeXml='false'/>"></ul>
  </div>
  <div class="showMore" id="morebutton_<c:out value='${facetSection}' escapeXml='false'/>">
    <input type="checkbox" title="MORE" aria-labelledby="morelink_${facetSection}_ACCE_Label" id="morelink_${facetSection}" name="morelink_${facetSection}" value="<c:out value='${facetSection}' escapeXml='false'/>:-1" onclick="javascript: SearchBasedNavigationDisplayJS.toggleShowMore(this, '<c:out value='${facetSection}' escapeXml='false'/>');"
    style="display:none">
    <span style="background-image:url(${imageDir}/down_arrow_sprite.png);  margin-left: 3px; padding-right: 14px;cursor: pointer;" class="expand_icon_open" id="expand_icon_${facetSection}" onclick="toggle('<c:out value='${facetSection}' escapeXml='false'/>'); return false;"></span>
    <label for="morelink_${facetSection}" id="showMoreLabel_${facetSection}" style="display: inline;color:#777777;font-size: small;font-family: Arial,sans-serif;font-weight: inherit;font-style: inherit;cursor: pointer;">
      <fmt:message key="LN_SEARCH_FACET_SHOW_ALL" />
    </label>
  </div>

</c:if>

这是我的jsp代码

toggleShowMore: function(element, id) {
  var section = $("moresection_" + id);
  var label = $("showMoreLabel_" + id);
  section.style.display = "none";
  label.innerHTML = this.moreMsg;
  section.focus();
}

我试图通过给出section.focus()来改变焦点;但没有工作。请帮忙

0 个答案:

没有答案