r/HTML • • 13h ago

Question Get Selected Values from Select Tag “multiple” HTML/JavaScript

Post image
4 Upvotes

I created a select tag in HTML and gave it multiple size=“1” to get a drop down multi select element on my website. The element works exactly how I want it to however, I have no idea how to get the selected values in JavaScript. If I use .value to get the value like I would in a select tag it will give me the value like normal if only 1 option is selected, and will give me undefined if none are selected but if multiple options are selected it returns a bunch of information I don’t understand how to parse.

Please help teach me how to get the selected values from my HTML multiple select tag in JavaScript.
Also if this isn’t a good subreddit for this post please help me find somewhere that could help me.


r/HTML • • 16h ago

What was the hardest part of learning HTML and CSS for you?

3 Upvotes

I’m curious to hear from people who have learned web development.

When you first started learning HTML and CSS, what did you find most difficult?

Was it understanding the basics, remembering all the tags and properties, making things look good with CSS, or actually building your first website?

And if you could give one piece of advice to someone just starting out, what would it be?

I’d love to hear your experiences!


r/HTML • • 10h ago

Small HTML/CSS issue for anyone wanting a first open source PR

2 Upvotes

I have a small open source project with a static web page, and I opened an issue meant for someone who has never contributed to open source before. It's adding a short info section to one HTML file. The text is already written in the issue, and there's a comment in the file showing where it goes. The tricky part is matching the existing CSS and making it look right on a phone.

https://github.com/eoSalinas/prensa/issues/62


r/HTML • • 13h ago

Opinion/Advice

1 Upvotes

Hello. This is my spacehey profile, i coded it from scratch myself, but i been having some trouble.

Im inspired off this myspace layout (i have the og code, i think), what do i change on mine to make it more accurate to the og pic, and how i do that?

https://spacehey.com/emoxitaquiinn

Its broken af on mobile, even if you switch to pc mode on your browser. Just in case you cant open it, this is how its looking like rn on pc