javascript - Change all links of a particular class on page load -


on this site, links inside inventory class need changed this link. can't find file edit , change link using javascript it. have written following code doesn't work.

<script type="text/javascript">        document.getelementbyclass("inventory").href="http://www.inspuratesystems.com/mandviwalla-motors/contact/";  </script> 

correct syntax:

document.getelementsbyclassname("inventory") 

if there's 1 such link on webpage try accessing first element above method returns array of dom objects

document.getelementsbyclassname("inventory")[0].href 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -