I am trying to grab the text in a p tag into a variable. The p tag is called #musCardImageTitle and is a description of the background image on that page. However, it's not working. I dont know why
var desc = document.getElementById("musCardImageTitle").innerHTML;
document.getElementById("sb_form_q").placeholder = desc
//the second line is putting that text into a searchbox as placeholder text
This is for the Bing homepage if it helps. I've included an image of what I'm trying to do if it helps
https://i.stack.imgur.com/bJeU8.jpg
I think this should be easy but for some reason I cant get it to work...
Try this one
This example is on MutationObserver doc