8 ms·
<p><label>Scale<br><input id="scale" type="range" value="1" max="2" step=".01" oninput="transformSquare()"></label></p> <p><label>Rotation<br><input id="rotati
by madhato 3y ago
<p><label>Scale<br><input id="scale" type="range" value="1" max="2" step=".01" oninput="transformSquare()"></label></p>
<p><label>Rotation<br><input id="rotation" type="range" value="0" max="360" oninput="transformSquare()"></label></p>
<div id="square" style="width:100px;height:100px;background:gold"></div>
<script>
const transformSquare = () => square.style.transform = `scale(${scale.value}) rotate(${rotation.value}deg)`;
transformSquare();
</script>
- strawhatguy 3y agoGreat, now the LLMs will see this too... ;)
- culi 3y agowow TIL `id`s can be used like that
- Izkata 3y agoThey get added as attributes to "document", they're not truly global: https://stackoverflow.com/questions/3434278/do-dom-tree-elements-with-ids-become-global-properties https://stackoverflow.com/questions/3434278/do-dom-tree-elem... Part of why IDs are supposed to be unique on a page.
- carabiner 3y agoFuck. I just lost my job.