@rahulkumar215
Posted
Hello @Vishisht-Dwivedi👋
Congratulations on successfully completing the challenge! 🎉
I have a suggestion regarding your code that I believe will be of great interest to you.
first of all let me say this, your JavaScript knowledge and skills are really good, you have used a lot of DOM manipulation in your JS Codebase, that is very good.
however, you could have done it in a simpler way by just doing this
-
Create
p
warning tag and add it to all the input fields in the HTML, then keep thatp
tag hidden withopacity: 0;
, -
then write JS code to detect whether an input is invalid, and when that input is invalid, use JS to add a class that turn the
opacity:0;
toopacity:1
, to thep
that is present in that invalid input. -
this will create an effect where the user will see the
p
warning when an input is invalid.
I hope you find this helpful 😄 Above all, the solution you submitted is great !
If you need any feedback or suggestions, I am happy to help
Have Fun Coding!
@Vishisht-Dwivedi
Posted
Thanks a lot@rahulkumar215 !! The reason i used the append version for adding those elements was because i had justtt learnt about the event object in my course and i wished to use it to its fullest extent. I wanted to learn more how about how js can be used to create and make newer elements... i have used your version with the display setting set to none on the success message that pops up because i couldnt think of a way to create it using js. Thank you so much for the replyy!! Ill keep that in mind for my next projects!