+ 1

how do i alert a form on my website

i want to alert a form when a button is pressed.

9th Aug 2017, 8:34 PM
Abdul Shakur Abbas Sakhr
Abdul Shakur Abbas Sakhr - avatar
1 ответ
+ 2
This may not cover everything fully (some elements use different attributes), but it's a start. <form onclick=iterate(this)> <input type="text" value="something"></input> <input type="radio" checked>Click the form somewhere</input> </form> <script> function iterate(el) { for(i in el.children) { var test = el.children[i].value; if(test !== undefined) alert(test); } } </script>
9th Aug 2017, 8:51 PM
Kirk Schafer
Kirk Schafer - avatar