My website is html/css only right now and I would prefer to keep it that way even though this is simple to implement with js.

  • IndigoGolem
    link
    fedilink
    arrow-up
    3
    ·
    8 days ago

    My own site had no JS at all for like a year, and even now only uses it for optional things. I keep JS disabled by default on sites i don’t trust, i shouldn’t expect anyone else to be more trusting about it.

    If it’s just a number, you could probably use <input type=“number”>, with some CSS to make the “increase” button take up the entire visible space. Maybe make that button transparent so you can see the displayed number behind it but can’t click it to type a number. But, like TragicNotCute said, it would reset when the page reloads.

    I suspect you can do some cool CSS tricks to adjust other things based on this number, but i have yet to figure stuff like that out. I also am only pretty sure it’s possible to style parts of an <input> like that. I still have not got around to styling any of the inputs on my site.

  • TragicNotCute
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 days ago

    You could do some wacky shit with CSS, but it wouldn’t persist on a refresh of the page. You should use JS for this. I’m wondering why you don’t want to?

  • 0t79JeIfK01RHyzo@lemmy.ml
    link
    fedilink
    English
    arrow-up
    2
    ·
    8 days ago

    You can always form submit and do server side processing on the input values. I’ve seen some complicated things with CSS, but I would just do a form submissions if the goal was no JS.