I am creating an extension with bootstrap modal whose form fields are title and description. I would like to pre-fill the title form field with the webpage's title using "document.title".
I have this code in my extension.js;
$("#myModal").bind( 'show', function () {
$("#title").val(document.title);
});
to prefill the title field which is not working.
I'm open to suggestions on how to fix this.
I'm creating the extension using crossrider api. The extension shows the bootstrap modal upon right-clicking a context menu on a web page. Thanks.