Tuesday, 3 March 2020

WT-11


Write a JavaScript program to accept a string and a position (number) from user and display the character at specified position.      
<html>
<body> 
<script type = "text/javascript">
var str=new String(prompt("Enter a string"));
for(i=0;i<str.length;i++)
{
document.writeln("<br />str.charAt("+i+") is:" + str.charAt(i));
}
</script>     
</body>
</html>

Write HTML code which generates the following output and display each element of list in different size, color & font. Use external CSS to format the list      
    Non flowering plants
o   Fern
o   Spore
     Flowering plants
   Lilly
   Rose
1.   Red Rose
2.   Pink Rose


<html>
<head>
<head><link rel="stylesheet" type="text/css" href="ab.css"></head>
<body>

<ul type = "disc">
<li>Non Flowering Plant</li>
<ul type = "circle">
<li>Fern</li>
<li>Spore</li>
</ul>
 
</ul>
             

<ul type = "disc">
<li>Flowering Plant</li>
<ul type = "square">
<li>Lilly</li>
<li>Rose</li>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<ol>
<li>Red Rose</li>
<li>Pink Rose</li>
</ol>
 </ul>

</ul>   
           
ab.css


body
{
background-image: url("1.jpg");
}
ol{color:red;}
ul{color:blue;}