Selectors, variable assignment and strange behavior?
I am stumped here, when using a selector's name attribute, perform a x.replace() on the variable, then attempting to get the new name of the attribute I am getting the original selector's name.
- $j('input[name*=\\[txtProductQuantity\\]]').bind('blur', function() {
- if ($j(this).val()) {
- var x = $j(this).attr('id').replace('txtProductQuantity','txtProductPrice');
- alert(x+' => '+$j('input[name^='+x+']').attr('name'));
- }
- });