I have the following in my .delegate:
link_id is the id of the link.
I need to next say if that id started with RPwd then do something.
Why doesn't ^= work in this case?
var link_id = $(this).attr('id'); //capture the id of the clicked link
if (link_id ^= "RPwd") {
The starts with ^= selector is a jQuery object selector. You're doing a string comparison, and can therefore use indexOf()
if (link_id.indexOf("RPwd") === 0) {
// Match
}
As far as I know ^= is not an operator in javascript. That could be your problem.
I think you are looking for
if ($(this).is('[id^="RPwd"]')) {
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With