O'Reilly logo

PhoneGap by Andrew Lunny

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – Making friends

First, we can set up the view for our new Make A Friend action:

  1. Let's modify the markup on our index.html appropriately:
    <body> <section id="find"> <h1>Find A Friend</h1> <input type="text" id="friendName" placeholder="What's your friend's name?" /> <button id="friendSubmit">Submit</button> <ul id="friendsList"></ul> <a href="#" target="make">Make a new friend</a> </section> <section id="make" style="display: none"> <h1>Make A Friend</h1> <form id="newFriend"> <input type="text" id="newName" placeholder="What's your friend's name?" /> <input type="tel" id="newPhone" placeholder="What's your friend's phone number?" /> <input type="email" id="newEmail" placeholder="What's your friend's email?" /> </form> <button id="newSubmit">Submit</button> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required