0% found this document useful (0 votes)
5K views

CSS Pract-9

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

CSS Pract-9

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

Practical No:-9 .

Develop a webpage using intrinsic java functions


Code-1:

<html>

<head>

<title>Using Intrinsic JavaScript Functions</title>

</head>

<body>

<FORM name="contact" action="#" method="post">

<P>

First Name: <INPUT type="text" name="Fname"/> <BR>

Last Name: <INPUT type="text" name="Lname"/><BR>

Email: <INPUT type="text" name="Email"/><BR>

<img src="submit.jpg"

onclick="javascript:document.forms.contact.submit()"/>

<img src="reset.jpg"

onclick="javascript:document.forms.contact.reset()"/>

</P>

</FORM>

</body>

</html>

Output:
Code-2:

<html>

<head>

<title>Insert a string within a specific position in another string</title>

</head>

<body>

<script>

function insert(main_string, ins_string, pos) {

if(typeof(pos) == "undefined") {

pos = 0;

if(typeof(ins_string) == "undefined") {

ins_string = '';

return main_string.slice(0, pos) + ins_string +

main_string.slice(pos);

}
var main_string = "Welcome to JavaScript";

var ins_string = " the world of ";

var pos = 10;

var final_string = insert(main_string, ins_string, pos);

document.write("Main String: <b>" + main_string + "</b><br/>");

document.write("String to insert: <b>" + ins_string + "</b><br/>");

document.write("Position of string: <b>" + pos + "</b><br/>");

document.write("Final string: <b>" + final_string + "</b>");

</script>

</body>

</html>

Output:

You might also like