#[JAVASCRIPT] Trouble finding getElementbyId(id) or getElementsByTagName(tagname)

1 messages · Page 1 of 1 (latest)

foggy ocean
#

Hello! I know this is Java and not Javascript discord, but I was really having trouble finding how to create a script that would check the checkboxes in this website. The website is just a barebones website for helping coders and programmers.

https://www.ironspider.ca/forms/checkradio.htm

I want to use JavaScript to change the checkboxes from Unchecked to Check. I feel like I can get everything right along, but I have a lot of trouble finding the Id or TagName for these checkboxes to check. Any help will be appreciated, Thanks a bunch! ❤️

low salmonBOT
#

<@&987246964494204979> please have a look, thanks.

low salmonBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

knotty cove
#

not sure where ur code is that you're trying to do the deckboxes with but note that you shouldn't have code like loc = (document.URL.indexOf('localhost') !=-1) ? "http://localhost/ironspider4/" : "http://www.ironspider.ca/";. You should do loc = "/"

foggy ocean
#

I'm not sure where that is written, I am using an external site Tampermonkey for script injection 😄 I wanted to check the boxes in the photo provided, the code on the right is for the boxes. My struggle is finding how to getelementsbyId, I was hoping it would be like "oh the Id for this checkboxes are given this Id here or you can find it by doing this" so I can finish the code 🙂

knotty cove
#

the snippet i sent is from ispider8.js

#

I'm not sure what a tampermonkey is and I dont think you should be using that

#

How are you building these webpages

foggy ocean
#

Tampermonkey 😄 It's a addon for your browser. My intent here was to add a script to my work which would automatically check any checkbox that had text, but I wanted to understand how to do that here first as a test dummy

knotty cove
#

so you're basically using a website to test using javascript on a website that you have direct access to?

foggy ocean
#

Yes 🙂

knotty cove
#

That's unneccesary

#

Are you like a highschooler or something?

foggy ocean
#

No, I just want to learn javascript through hands-on methods

knotty cove
#

ok well this is a very naive approach

#

you have a static website, develop it statically

#

get VSC and live server and use it

foggy ocean
#

will that help me to find the id of the checkboxes in the first image so I can check them through js

knotty cove
#

VSC will help you write actual code

#

i have no idea how you've written this file