Something like doesn't work, what's the work around?
var tgtCol = $('td[aria-describedby=tblGrid_Subject]');
var tgtHdr = $('#tblGrid_Subject');
$(tgtHdr, tgtCol).attr('colSpan', '3');
Definition and Usage. The element selector can also be used to select multiple elements. Note: Seperate each element with a comma.
To select multiple elements, you can use the querySelectorAll() method. Just like the querySelector() method, you usually use it on the document object.
$ is another, which is just an alias to jQuery . $$ is not provided by jQuery. It's provided by other libraries, such as Mootools or Prototype. js. More importantly, $$ is also provided in the console of modern browsers as an alias to document.
So far we have covered only three standard jQuery Selectors.
var tgtCol = $('td[aria-describedby=tblGrid_Subject]');
var tgtHdr = $('#tblGrid_Subject');
$(tgtHdr).add(tgtCol).attr('colSpan', '3');
This will also work:
var stuff = $('td[aria-describedby=tblGrid_Subject], #tblGrid_Subject');
stuff.attr('colSpan', '3');
You're close, you may combine multiple selectors with a comma, like so:
$('td[aria-describedby=tblGrid_Subject], #tblGrid_Subject').attr('colSpan', '3');
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