This is a simple web application that demonstrates how to consume an API on a button click using vanilla JavaScript.
- User enters a rapper's name in the input field.
- On button click, the app fetches data from a public API and displays the rapper's birth name.
site link (https://knowyourrapper.netlify.app)
index.html
css/
js/
main.js
index.html: The main HTML file containing the UI.js/main.js: Handles the API request and updates the UI.
- Open
index.htmlin your browser. - Enter a rapper's name in the input field.
- Click the "Click Me" button.
- The birth name of the rapper will be displayed under "Result".
This project uses the following API endpoint:
https://my-first-crud.onrender.com/api/{rapperName}
Replace {rapperName} with the name you want to search for.
- Input:
eminem - Output:
Marshall Bruce Mathers III
This project is for educational purposes.
