0% found this document useful (0 votes)
3 views1 page

New HTML

Uploaded by

pratik gosavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

New HTML

Uploaded by

pratik gosavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

<html>

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></
script>
</head>
<body>
<p>Html Form Handling</p>
<form method="GET" action="INDEX2.HTML" id="FORM1" CLASS="FORM1" name="form1">
<INPUT TYPE="text" ID="name" NAME="name" value="textvalue" label="" placeholder=""
/>
<input type="button" id="submit" name="submit" onclick="btnsubmit()" value="Submit"
/>
</form>

<button onclick="myFunction()">Click me</button>

<p id="demo">paragraph</p>

<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World";
}
</script>
<script type="text/javascript">
console.log('working');
const form = document.querySelector('#form1')
console.log(form);

function btnsubmit()
{
console.log('button press');
var txt = Object.values(form).reduce((obj,field) => { obj[field.name] =
field.value; return obj }, {});
console.log(txt);
}
</script>
</body>
</html>

You might also like