Disclaimer Generator in HTML with JS

Disclaimer Generator
CSS code (style.css): css Copy code body { font-family: Arial, sans-serif; } h1 { text-align: center; }Baby care products form { display: flex; flex-direction: column; max-width: 500px; margin: 0 auto; } label { margin-top: 10px; } input, textarea { padding: 10px; border: none; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); margin-bottom: 20px; } input[type="submit"] { background-color: #4CAF50; color: white; cursor: pointer; } input[type="submit"]:hover { background-color: #3e8e41; } #generated-disclaimer { max-width: 500px; margin: 20px auto; padding: 10px; border-radius: 5px; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); } JS code (script.js): js Copy code function generateDisclaimer() { const company = document.getElementById("company").value; const website = document.getElementById("website").value; const disclaimer = document.getElementById("disclaimer").value; const generatedDisclaimer = `${company} Disclaimer
By accessing ${website}, you agree to be bound by the following disclaimer:
${disclaimer}
`; document.getElementById("generated-disclaimer").innerHTML = generatedDisclaimer; } This code will create a simple form with fields for the company name, website URL, and disclaimer text. When the user clicks the "Generate Disclaimer" button, the JS function generateDisclaimer() will create a disclaimer based on the input values and display it below the form. The CSS styling will make the form and generated disclaimer look good on screens of different sizes
Comments
Post a Comment