<head> <title>A joke</title> <meta charset="utf-8" /> </head> <body> <form action="get"> <div>Title</div> <input type="text" name="title"></html>
<div>Author</div> <input type="text" name="author">
<div>Publisher</div> <input type="text" name="publisher">
<div>Year</div> <input type="text" name="year">
<button onclick="save somth">Save</button> </form> <?php ?> </body>
<title>JavaScript </title></head> <body>
<form> <label>Title<input id = "title" type = "text"></label> <label>Author<input id = "author" type = "text"></label> <label>Publisher<input id = "publisher" type = "text"></label> <label>Year<input id ="year" type = "text"></label> <button onclick = "book={ title: document.getElementById('title').value, author: document.getElementById('author').value, publisher: document.getElementById('publisher').value, year: document.getElementById('year').value
}; ">Save</button> </form> <a href="#" onclick = " bookAsString=''; if(typeof book !== undefined){ for(prop in book){ bookAsString+=book[prop]+'\n'; } } alert(bookAsString); ">Show Book</a></body> </html>
<head> <title></title> <meta charset="utf-8" /> </head> <body> <form> <label for="title">Title</label> <input id="title" type="text"> <label for="author">Author</label> <input id="author" type="text"> <label for="publisher">Publisher</label> <input id="publisher" type="text"> <label for="year">Year</label> <input id="year" type="text"> <input id="submit" type="submit" value="Save" onclick= "book = { title: document.getElementById('title').value, author: document.getElementById('author').value, publisher: document.getElementById('publisher').value, year: document.getElementById('year').value }; alert( 'Title: '+book.title+'\n'+ 'Author: '+book.author+'\n'+ 'Publisher: '+book.publisher+'\n'+ 'Year: '+book.year);"> </form> </body></html>
<head> <title>potato</title> </head> <body> <div> <label for="title">Title</label> <input type="text" name="title" id="title">
<label for="title">Author</label> <input type="text" name="author" id="author">
<label for="title">Publisher</label> <input type="text" name="publisher" id="publisher">
<label for="title">Year</label> <input type="text" name="year" id="year">
<button onclick="savebook()">Save</button> </div>
<script type="text/javascript"> var savebook = function() { var book = { title: document.getElementById('title').value, author: document.getElementById('author').value, publisher: document.getElementById('publisher').value, year: document.getElementById('year').value };
alert("Title: " + book.title + "\nAuthor: " + book.author + "\nPublisher: " + book.publisher + "\nYear: " + book.year); }; </script> </body></html>
<head> <meta charset="utf-8"> </head>
<body> <label for="title">Title</label>
<input type="text" id="title">
<label for="author">Author</label>
<input type="text" id="author">
<label for="publisher">Publisher</label>
<input type="text" id="publisher">
<label for="year">Year</label>
<input type="text" id="year">
<input type="submit" value="Save" onclick= "book = { title: document.getElementById('title').value, author: document.getElementById('author').value, publisher: document.getElementById('publisher').value, year: document.getElementById('year').value }; alert('Title: '+ book.title + '\n'+'Author: '+ book.author + '\n'+'Publisher: '+ book.publisher + '\n'+'Year: '+ book.year);"> </body></html>
<title>Build Something</title></head> <body>
<label>Title</label> <input id="title"> <label>Author</label> <input id="author"> <label>Publisher</label> <input id="publisher"> <label>Year</label> <input id="year"> <button onclick="book()">Save</button>
function book(){ var data = { Title: document.getElementById("title").value, Author: document.getElementById("author").value, Publisher: document.getElementById("publisher").value, Year: document.getElementById("year").value }; var msg = document.getElementById("result"); if(typeof data === 'undefined') { alert("variable data is undefined"); } else { return msg.innerHTML = "Title: " + data.Title +"</script>
"+ "Author: "+ data.Author +"
"+ "Publisher:" + data.Publisher +"
"+ "Year: " + data.Year; } }
<html> <head> <title>Lets buils something</title> </head> <body> <form> <input type="text" id="title" /> <input type="text" id="Author" /> <input type="text" id="publisher" /> <input type="text" id="year" /> <input type="submit" value="save" onclick="book = new Object();book.titleval=document.getElementById('title').value; book.authorval=document.getElementById('Author').value; book.publisherval=document.getElementById('publisher').value; book.yearval=document.getElementById('year').value; alert(book.titleval+'\n'+book.authorval+'\n'+book.publisherval+'\n'+book.yearval);"/> </form> </html>
<title> Book Details </title></head> <body>
<form> Title:</body> </html>
<input type="text" id="formtitle"/>
Author:
<input type="text" id="authname"/>
Publisher:
<input type="text" id="pubname"/>
Year:
<input type="text" id="year"/>
<input type="button" value="Save" onclick="return storeInfo();"/> </form> <script type="text/javascript"> function storeInfo() { book = new Object(); book.title = document.getElementById("formtitle").value; book.authname = document.getElementById("authname").value; book.pubname = document.getElementById("pubname").value; book.year = document.getElementById("year").value; alert(book.title+book.authname+book.pubname+book.year); } </script>