Skip to main content

HTML CSS-Week 4

4.Write an HTML page that contains a selection box with a list of 5 countries. When the user selects a country, its capital should be printed next to the list. Add CSS to customize the properties of the font of the capital (color, bold and font size).

<html>
          <head>
          <title>WT Lab Experiment-4</title>
          <style>
          #cc {
          color: red;
          font: 20px verdana;
          font-weight: bold;
          }
</style>
<script>
function getCapital()
{
          var x;
          x = parseInt(document.getElementById("c").value);
          switch(x)
          {
          case 1: document.getElementById("cc").value = "New Delhi"; break;
          case 2: document.getElementById("cc").value = "Mascow"; break;
          case 3: document.getElementById("cc").value = "Nairobi"; break;
          case 4: document.getElementById("cc").value = "Beizing"; break;
     case 5: document.getElementById("cc").value = "Koulalumpur";
                 break;
          }
}
</script>
          </head>
          <body>
          <form name="f1" method="get">
<b><br><br>
          Select Country : <select id="c" name="c" onChange=getCapital()>
                 <option>- Select Country -</option>
                 <option value="1">India</option>
                 <option value="2">Rassia</option>
                 <option value="3">Kenya</option>
                 <option value="4">China</option>
                 <option value="5">Singapur</option>
                 </select><br><br><br><br>
&nbsp;&nbsp;&nbsp;&nbsp;Capital City : <input type="label" id="cc" name="cc" width="30"/>
</b>
</form>
</body>

</html>

output


HTML CSS-Week 4




For more info regarding technology and pro stuff...visit http://peoplezmind.com/

Comments

Popular posts from this blog

RSA Algorithm For Encryption and Decryption

#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<math.h> #include<string.h> long int p,q,n,t,flag,e[100],d[100],temp[100],j,m[100],en[100],i; char msg[100]; int prime(long int); void ce(); long int cd(long int); void encrypt(); void decrypt(); void main() { printf("\nENTER FIRST PRIME NUMBER\n"); scanf("%d",&p); flag=prime(p); if(flag==0) { printf("\nWRONG INPUT\n"); getch(); exit(1); } printf("\nENTER ANOTHER PRIME NUMBER\n"); scanf("%d",&q); flag=prime(q); if(flag==0||p==q) { printf("\nWRONG INPUT\n"); getch(); exit(1); } printf("\nENTER MESSAGE\n"); fflush(stdin); scanf("%s",msg); for (i=0;msg[i]!=NULL;i++) m[i]=msg[i]; n=p*q; t=(p-1)*(q-1); ce(); printf("\nPOSSIBLE VALUES OF e AND d ARE\n"); for (i=0;i<j-1;i++) printf("\n%ld\t%ld",e[i],d[i]); encrypt(); decrypt(); getch(); } int prime(long i...

CRC-Cyclic Redundancy Check Program

#include <stdio.h>  #include <conio.h>  #include <string.h>  void main() { int i,j,keylen,msglen; char input[100], key[30],temp[30],quot[100],rem[30],key1[30]; printf("Enter Data: "); gets(input); printf("Enter Key: "); gets(key); keylen=strlen(key); msglen=strlen(input); strcpy(key1,key); for (i=0;i<keylen-1;i++) { input[msglen+i]='0'; } for (i=0;i<keylen;i++) temp[i]=input[i]; for (i=0;i<msglen;i++) { quot[i]=temp[0]; if(quot[i]=='0') for (j=0;j<keylen;j++) key[j]='0'; else for (j=0;j<keylen;j++) key[j]=key1[j]; for (j=keylen-1;j>0;j--) { if(temp[j]==key[j]) rem[j-1]='0'; else rem[j-1]='1'; } rem[keylen-1]=input[i+keylen]; strcpy(temp,rem); } strcpy(rem,temp); printf("\nQuotient is "); for (i=0;i<msglen;i++) printf("%c",quot[i]); printf("\nRemainder is "); for...

Dijkstra Algorithm

Program to find the shortest path #include<stdio.h> #include<string.h> #include<math.h> #define IN 99 #define N 6 int dijkstra(int cost[][N], int source, int target); int dijsktra(int cost[][N],int source,int target) {     int dist[N],prev[N],selected[N]={0},i,m,min,start,d,j;     char path[N];     for(i=1;i< N;i++)     {         dist[i] = IN;         prev[i] = -1;     }     start = source;     selected[start]=1;     dist[start] = 0;     while(selected[target] ==0)     {         min = IN;         m = 0;         for(i=1;i< N;i++)         {             d = dist[start] +cost[start][i];             if(d< dist[i]&&selected[i]==0)       ...