<input type="checkbox" name="checket" id="checket" />
$url = 'test.com';
and when i check it i want it to go to a url: href='$url'
and remember that has been checked.
any ideas?
thanks
edit:
maybe
if ($('#checket:checked').val() !== undefined) {
// Insert code here.
}
Without using a JS library like jquery or mootools, here’s how to do it in barebones JS:
Note that I’ve split the tag across multiple lines so it’s easier to read. basically, embed the desired url into the checkbox’s value field, then put an onclick handler that’ll read out that URL and feed it to window.location when the checkbox becomes checked.