I want to select a div with class textbox and also has a data-title that starts with the string in the variable dt.
Something like this:
var $theboxes = $(".textbox[data-title^="+dt+"]");
I’ve tried this but it causes an error in jquery. What’s the right way to do this?
I think you actually need to quote the attribute value.
Try something like this: