I have working Jquery written in this format to rename a span:
// [A]
let _href_w = $('span').filter(function () {
return this.innerHTML == 'originalText';
})
_href_w.text("replaceOriginalText") //rename span
now I need a function to replace the placeholder of textarea:
HTML
<textarea placeholder="TypeHere"></textarea>
JQUERY
var textarea = $('textarea').filter('[placeholder="TypeHere"]');
textarea.attr('placeholder','replaceTypeHere');
but I would like it to be written like [A]
I tried:
let _href_w = $('textarea').filter(function () {
return this.attr('placeholder') == 'TypeHere';
})
_href_w.attr('placeholder','replaceTypeHere') //rename textarea_placeholder
but error shows: this.attr is not a function
how can I rewrite this?