代码之家  ›  专栏  ›  技术社区  ›  Joh

Remove event with jquery

  •  1
  • Joh  · 技术社区  · 15 年前

    I have the following at html code

    <a class="toolbar" onclick="javascript: submitbutton('items')" href="#">
    

    Now i want that in jquery i convert it to

     <a class="toolbar" href="javascript:history.go(-1)">
    

    任何想法

    1 回复  |  直到 15 年前
        1
  •  3
  •   Kai    15 年前

    Do you mean like that?

    $('.toolbar').removeAttr('onclick').attr('href','javascript:history.go(-1)');