Here is what I have:
$(function() {
$('#find_1 input[type="checkbox"]').change(function() {
var $t = $("#t");
if ( this.checked )
$t.append(($t.text()?",":"")+this.value);
else
$t.text($t.text().replace(
new RegExp("\\b"+this.value+"\\b"), ""
));
}).change();
});
What I need is to write the checkbox value in the a href of the target #t
For example:
The selected checkboxes:
[x]red
[ ]green
[x]blue
Should result in a href like this:
<div id"t"><a href"/colors/red,blue">preview colors</a>
Of course the colors will be added/removed as the user click/unclick the checkboxes.
Thanks for the help.