Dynamically adding data toggle and data target in li using jquery

I am building the theme in word press and i want my modal to link to the menu links. I am trying to add data-toggle in Li using j query but no result is occurring.

<script type="text/JavaScript">
    j Query("#menu-item-135").add("data-toggle", modal);
});
</script>

Related posts

1 comment

  1. Use this code it will add attributes in your menu

    <script type="text/JavaScript">
    $(document).ready(function(){
      $("#menu-item-69").attr("data-toggle",'modal');
    });
    </script>
    

Comments are closed.