0

Help using JS to ā€œcopy/pasteā€ on website

I’m trying to reference text elements on a website and then use them to fill in the website’s form fields. Currently I’m missing a basic execute/run program command. I also need help successfully referencing the specified html elements. Thanks! Here’s my basic approach: document.getElementById('FormField').value =document.getElementsByClassName('ReferenceText').innerHTML Here’s the full code (JavaScript and the relevant sections of html). https://code.sololearn.com/WBg8Oos528jP/?ref=app

20th Sep 2021, 3:21 AM
Randy
Randy - avatar
3 Answers
+ 1
https://code.sololearn.com/WBaS00dsbVKQ/?ref=app Is this what you are trying? Check code inside script on html If is , you was set value to be string not exual value, also when you use class, you got array thats whay you need to access using indexes.
20th Sep 2021, 5:33 PM
PanicS
PanicS - avatar
+ 1
I’ll have to double check it on my mac’s automator tomorrow but I think you fixed the two problems I was having. Thanks Sanja!!!
21st Sep 2021, 3:37 AM
Randy
Randy - avatar
+ 1
Also if you dont know exacly index you can console.log and check, but much better is to use id for selecting elements
21st Sep 2021, 12:12 PM
PanicS
PanicS - avatar