Question: Write the full HTML and JavaScript codes based on the following requirements: (12 marks) a. HTML (2 marks) i. A textbox to enter postcode ii.

 Write the full HTML and JavaScript codes based on the following

Write the full HTML and JavaScript codes based on the following requirements: (12 marks) a. HTML (2 marks) i. A textbox to enter postcode ii. A submit button iii. A section or division

to display the final HTML output b. JavaScript (10 marks) Add an event listener to link the submit button with a function of findAddress(). In function findAddress(): i. append the postcode to the URL http://api.postalcodes/my/ Example: if the user input is "68100, the URL becomes http://api.postalcodes/my/68100 ii. send an Ajax request to the above URL to get a sample JSON result as follows: { "postcode": "68100", "country": "Malaysia", "location":( { "city" : "Batu Caves", "state" : "Kuala Lumpur } ] } iii. display the final output of "city" and "state" to the HTML division or section that you have defined in HTML

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!