Indeed. Jekyll makes static pages which are dumb and flat.
You can add JS to your Jekyll site to make it more dynamic, like filtering a list on a page based on the text in a text box or in the query params like ?search=term
.
I would separate the two steps mentally. Use Jekyll to build your site. You get HTML output. All includes and templates and configs can be removed even, because the HTML exists as output.
On top of your static site, you can use JS to get values from inputs.
I would suggest building your JS logic on a plain HTML page outside of jekyll, to force yourself to solve the JS logic with a hardcoded element ID or whatever else you want to make Jeykll set. And after that you can bring your JS to your Jekyll site.
And again, as I said before, you can use a Jekyll variable with a single value and you use as an includes parameters and use it to set the value of a JS variable.
Going back to example, your Jekyll code can be
---
my_value: abcdef
---
<script>
var myId = "{{ my_value }}" // using Jekyll variable to set a JS variable
var el = document.getElementById(myId)
console.log(el)
el.setAttribute("width", "1000px")
</script>
And that will get converted to static HTML.
And the JS won’t care about Jekyll at all.
The script tag will be rendered as this and that is what runs on the browser.
<script>
var myId = "abcdef";
var el = ...
...
Note how my_value can come from frontmatter or data file or an assigned variable or another page. And it gets inserted inside your JS and then stays fixed.
But not from a URL param or a form because Jekyll makes HTML and finishes running. Jekyll can never see what the user enters on the page because it is just static HTML.