I want to remove href attribute from certain navigation links when screen size is less than 768px. The navigation is dynamically generated with ajax and takes some time to load. I'm trying the following code but it is not working, but it works when the navigation is static(not ajax). 

```
$(document).ready(function () {
 if ($(window).width() < 768) {
    $("#main-navigation > li.dropdown > a").removeAttr("href");
  }
});

```

Thanks for some help