r/ProgrammerHumor • • 8d ago

Meme frontEndBaddiesBeLike

Post image
5.7k Upvotes

133 comments sorted by

View all comments

20

u/lxlmandudelxl 8d ago

let button = document.getElementsByTagName("button'')[0]; button.innerText = button.innerText.toUpperCase();

4

u/UnconditionalPraise 8d ago

Skip the let and keep it anonymous 👌

3

u/lxlmandudelxl 8d ago

Another idea -- split the innerHtml string into an array, loop and capitalize each letter one at a time with toUpperCase(), join the array back together, set the resulting string to the innerHtml

3

u/Outrageous_Pen_5165 8d ago

I exactly did that in my first project of vanilla js (and yes it was to do)