css - Javascript to hide div and href in the same link -


i have link sets cookie , hides div (intro) when clicked. want go url (a href) when clicked, while still running code hide div , set cookie. how achieve this?

currently have cookies code:

 $(document).ready(function() {      if (!readcookie('my-intro')) {      $('#intro').show();    }      $('#close').click(function() {      $('#intro').hide();      createcookie('my-intro', true, 1)      return false;    });   }); 

(note there's more code "createcookie" function, don't think that's relevant problem, removed keep cleaner).

and current link:

<a href="javascript:void(0)" id="close">close , go url</a> 

the problem above, need close , go url, can't seem set have "href" javascript.

thank in advance help.

just enter link under href attribute, , return true @ end of click function.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -