A small front-end project that lets users enter their name, age, favorite color and a short bio, then generates a simple profile card.
index.html— main HTML page with form and output area.style.css— styling for the form and profile card.script.js— JavaScript that reads the form, validates input, and generates the profile card.
- Open
index.htmlin your browser (double-click the file or use "Open with Live Server" in VS Code). - Fill the form fields and click "GENERATE PROFILE".
No build tools or dependencies are required — it's plain HTML/CSS/JS.
- Fixed a runtime bug that prevented profile generation: there was a typo calling
name.tuUpperCase()instead ofname.toUpperCase(). That threw an error and stopped the script. - Removed the "VARIABLE IN ACTION" tracker UI and its associated JS/CSS to simplify the page and remove a potential source of runtime errors.
If you prefer the tracker restored instead of removed, see "Revert or hide the tracker" below.
-
Revert (restore original behavior): undo the changes to
index.html,script.js, andstyle.css(recover the removedvariable-trackerblock and the event listeners for#trackName,#trackAge,#trackColor,#trackBio). If you use version control (git) rungit checkout -- <file>on the modified files. -
Non-destructive hide: instead of removing the tracker, wrap it in a container and toggle with CSS or a small boolean in
script.js. Example (quick idea):- Add
id="variableTracker"to the trackerdiv. - In CSS:
.hidden { display: none !important; } - To hide by default, add the
hiddenclass in the HTML. To toggle, add/remove the class via a button inscript.js.
- Add
- The form validates that name and age are present. Age is not range-checked (e.g., negative numbers or very large values). Add extra validation if you need stricter rules.
MIT — feel free to use and adapt.