Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 2 years ago

Interactive card details form solution with custom js, css html

accessibility
Ravindra Reddy•180
@ravindra135
A solution to the Interactive card details form challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Please Suggest me on how to do real time updating, the card number also the input outline is not changing to gradient. Feel Free to give me suggestion on improvement in code.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Vaibhav Bhardwaj•150
    @VaibhavBhardwaj23
    Posted over 2 years ago

    For doing real time Updating you have to target the form input field and the text in card, use the event of "onkeyup",and set the input box value to the text in form value. For example: <input type="text" id="card-number" onkeyup="display1()"> // This is for your Input Section <span id="num">0000 0000 0000 0000</span> // This for your card //Now in JS define the function display1() function display1() { var cnum=document.getElementById.("card-number").value; //This will take the value from input box document.getElementById.("num").innerHTML=cnum; //This will change the value in real-time } //

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord
Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub