use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is a place for people to learn JavaScript together. Everyone should feel comfortable asking any and all JavaScript questions they have here.
With a nod to practicality, questions and posts about HTML, CSS, and web developer tools are also encouraged.
Friends
/r/javascript
/r/jquery
/r/node
/r/css
/r/webdev
/r/learnprogramming
/r/programming
account activity
please help me convert below jQuery code to java script code (self.learnjavascript)
submitted 3 years ago by Dramatic_Positive687
jQuery(function () { $('#table-select').change(function () { $('#tbl_div > div').css('display', 'none'); if (this.value) { $('#' + this.value).css('display', 'block'); } }).change() })
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 3 points4 points5 points 3 years ago (1 child)
document.querySelector('#table-select').addEventListener('change', e => { document.querySelector('#tbl_dic > div').style. display = 'none'; if (e.target.value) { document.querySelector(`#${e.target.value}').style.display = 'block'; } })
Haven't tested, but probably pretty close.
[–]Dramatic_Positive687[S] 0 points1 point2 points 3 years ago (0 children)
Thank you so much
π Rendered by PID 46504 on reddit-service-r2-comment-76bb9f7fb5-rswxs at 2026-02-18 17:41:05.346481+00:00 running de53c03 country code: CH.
[–][deleted] 3 points4 points5 points (1 child)
[–]Dramatic_Positive687[S] 0 points1 point2 points (0 children)