繁体   English   中英

当我们单击任何一个href链接时,如何隐藏其他href链接,链接是动态的

[英]how to hide other href links when we click any one href links , links are dynamic

function addChildAccord(childAccord) {
    var abcde = childAccord.toString();
    var element = document.createElement("input");
    //Assign different attributes to the element.
    element.setAttribute("type", "text");
    element.setAttribute("name", "abcde");
    element.setAttribute("id", "abcde");
    element.setAttribute("value", abcde);
    element.setAttribute("readonly", "readonly");
    var createdElem = document.getElementById("filterElementId");
    //Append the element in page (in span).
    createdElem.appendChild(element);
}

function check(link) {
    alert(link);
    $(link).replaceWith($(link).text());
}

//这会创建动态链接,当用户单击任何链接时,我需要它,其他链接应隐藏或禁用$ {autnValue}

您可以通过添加一些类来隐藏链接

$('body').on('click','input',function(){
   //Hide all links
   $('input').addClass('hidden');
   //Unhide clicked one
   $(this).removeClass('hidden');
   ...
   //other code
   ...
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM