[KilleR] Posted October 18, 2019 Share Posted October 18, 2019 (edited) السلام عليكم شلون اربط الانبوت بالزر بحيث اذا كتب شي بالانبوت وضغط عالزر ينفذ له شي مثال <html> <body> <input type="text" id="input"></input> <button type="submit" id="button" onclick="d">Count</button> <p id="demo"></p> <script> function d () { var i = window.input document.getElementById("demo").innerHTML = txt.length; } </script> </body> </html> Edited October 18, 2019 by [KilleR] Link to comment
MrBiG Posted October 18, 2019 Share Posted October 18, 2019 وعليكم السلام ورحمة الله وبركاتة https://www.w3schools.com/js/js_validation.asp Link to comment
el8rbawy Posted October 19, 2019 Share Posted October 19, 2019 (edited) <body> <form> <input type="text" name="text" id="input" placeholder="Enter Text" /> <button type="submit">Print Now</button> </form> <p id="text"></p> <script> let form = document.querySelector('form'), input = document.getElementById('input'), text = document.getElementById('text') form.addEventListener('submit', (e) => { e.preventDefault() // منع الافتراضي الي هو تحديث الصفحة لارسال البيانات للسيرفر text.innerHTML = input.value }) </script> </body> Edited October 19, 2019 by NitroNN Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now