I know this may seem really simple but am having trouble this end figuring out a way of selecting the class and changing ONLY that href.. here is the html ...
<a href="http://www.something" class="theclassname">LEARN MORE</a>
so far with javascript ...
$('.theclassname').click(function(){
(change the href to www.awesome.com)
});
So far really appreciate alll answers on this ... I need the href to change but not go to the url that it has changed to until the user clicks once more... so far the actual code is this ...
$('.hrefclass').click(function () {
e.preventDefault();
$(this).attr("href", "http://www.google.org/");
$('.kwicks').kwicks({
maxSize: '100%',
behavior: 'menu'
});
});
however this does not appear to work .
LATEST
Ok so adding return false indeed works but also stops the kiwcks function from running ... how can i get around this ?
$('.hrefclassname').one("click", function() {
$('.kwicks').kwicks({
maxSize: '100%',
behavior: 'menu'
});
$(this).attr("href", "http://www.gooogle.org/");
return false;
});
LATEST LATEST
$('.HREFCLASSNAME').one("click", function() {
e.preventDefault();
$(this).attr("href", "http://www.GOOGLE.org/");
$('.kwicks').kwicks({
maxSize: '100%',
behavior: 'menu'
});
});