0

I would like to paste some pre-defined text to a textbox of a website using chrome extension. The target website is https://www.urlgot.com/. It is a seemly simple webpage with only one input textbox. I had found a solution to get my interesting DOM content. But how to manipulate the DOM to paste my text into the "placeholder" then? As a neophyte in chrome extension scripting, I really need some advice.

The DOM of interesting is as below,

<div class="form-group" id="urlFormGroup">
 <input type="text" class="form-control" id="mediaWebUrl" autocomplete="off" placeholder="paste link here ..." onpaste="parse()">

I think I should find some way to replace the "paste link here ..." text with my own text input. But I don't know how to do it. Thank you.

Wei Zhang
  • 325
  • 2
  • 16

1 Answers1

0

You can use this:

document.getElementById('mediaWebUrl').setAttribute('placeholder','My own text...');
Iván Nokonoko
  • 4,888
  • 2
  • 19
  • 27