Can your please alter the Code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can your please alter the Code?

In the following program, I've used id selector (box), but I want to use class selector. Please alter the code written in this code without altering the output. https://code.sololearn.com/WGPXTrVJ7fz0/?ref=app

1st Jul 2018, 3:24 PM
Çůřîöş ßąšäñț 🇮🇳
Çůřîöş ßąšäñț 🇮🇳 - avatar
7 Answers
+ 4
<!DOCTYPE html> <html> <head> <title>MyBoxIsMyBoxNoneOfYourBox!</title> <style> /* Here will your CSS code */ </style> </head> <body> <div class="box" onclick='itsMe()'>TAP ON ME!</div> <script> // Here will be your JS code (as mentioned by @Calvin) </script> </body> </html>
1st Jul 2018, 4:37 PM
777
777 - avatar
+ 2
It works on Chrome too.
1st Jul 2018, 4:05 PM
Calviղ
Calviղ - avatar
+ 1
Thanks Calviղ , but this is what I exactly did with Google Chrome, but it doesn't works though. So I got confused with the concepts, therefore asked for it. So what to do with it to work as fine on Chrome?
1st Jul 2018, 3:53 PM
Çůřîöş ßąšäñț 🇮🇳
Çůřîöş ßąšäñț 🇮🇳 - avatar
+ 1
Calviղ No, I mean not on Sololearn website, but offline, with notepad
1st Jul 2018, 4:09 PM
Çůřîöş ßąšäñț 🇮🇳
Çůřîöş ßąšäñț 🇮🇳 - avatar
0
<!DOCTYPE html> <html> <head> <title>MyBoxIsMyBoxNoneOfYourBox!</title> <style> #box{ width: 200px; background: red; color: white; margin: auto; text-align: center; padding: 50px 0; font: bold 20px cambria; } </style> </head> <body> <div id="box" onclick='itsMe()'>TAP ON ME!</div> </body> </html>
1st Jul 2018, 4:15 PM
KrOW
KrOW - avatar
0
Re: "No, I mean not on Sololearn website, but offline, with notepad" Hi Çůřîöş ßąšäñț 🇮🇳, Not sure if this would help answer your question, but maybe try: https://code.sololearn.com/W326FKwAKXtN
1st Jul 2018, 5:11 PM
Janning⭐
Janning⭐ - avatar