Simple Html page with list, link, image, and table

<!--- this is a comment -->
<html>

 <head>
  <title>Simple page</title>
 </head>

 <body>
  Paragraph 1
  <p>
  Paragraph 2
  <p>

  <!--- list -->
  <ul>
  <li>item 1</li>
  <li>item 2</li>
  </ul>

  <!--- link -->
  <a href="http://www.devarchweb.net">www.devarchweb.net</a><br>

  <!--- image -->
  <img src="myphoto.jpg" />

  <!--- table -->
  <table border="1">
   <tr>
    <td>cell 1</td> <td>cell 2</td>
   </tr>
   <tr>
    <td>cell 3</td> <td>cell 4</td>
   </tr>
  </table>

 </body>
</html>


More info and samples on: www.devarchweb.net

Create html form with all element types

<FORM action="form_response.htm" method="post">
 <INPUT type="radio" value="red" name="color" >Red
 <INPUT type="radio" value="blue" name="color" checked>Blue
 <INPUT type="radio" value="green" name="color">Green
 <br>

 <input type="checkbox" name="quick" value="yes" checked>Expedite<br>

 <select name="comboOptions">
  <option value="opt1">Option 1</option>
  <option value="opt2" selected>Option 2</option>
 </select><br>

 <select name="listOptions" size=2 multiple>
  <option value="item1">Item 1</option>
  <option value="item2" selected>Item 2</option>
 </select><br>

 Name: <input type="text" name="firstName">
 <input type="button" onclick="alert("Name selection not implemented") value="Select name">
 <button type="button" onclick="alert("Name selection not implemented")">Select name</button>
 <br>
 <br>
 Password: <input type="password" name="pwd"><br>
 <br>
 <INPUT type="submit" value="Submit form">
</FORM>


More info and samples on: www.devarchweb.net

Manipulate cookies in JavaScript

// Create 1 day valid cookie
document.cookie =
  "myKey=myValue +
  "; max-age=" + 60*60*24 +
  "; path=/" +
  "; domain=devarchweb.net";

// get all cookies
var allCookies=document.cookie;

function getOneCookie(myKey)
{
var searchKey = myKey + "=";
var cookies = document.cookie.split(';'); // creates array of all cookies from "myKey1=myValue;myKey2=myValue2"
for(var i=0; i<cookies.length; i++)
{
  var cookie = cookies[i].trim();
  if (cookie.indexOf(searchKey)==0) return cookie.substring(searchKey.length, cookie.length);
}
return "";
}


More info and samples on: www.devarchweb.net

Manipulate cookies in ASP

Write cookie
<%
Response.Cookies("myKey")="myValue"
Response.Cookies("myKey").Expires=#June 16,2015#
%>

Read cookie
<% myValue=Request.Cookies("myKey") %>


More info and samples on: www.devarchweb.net

Manipulate cookies in PHP

Write 1 day valid cookie
<? setcookie("myKey", "myValue", time()+60*60*24); ?>

Read cookie
<?
if (isset($_COOKIE["myKey"]))
  myValue = $_COOKIE["myKey"];
?>


More info and samples on: www.devarchweb.net

Manipulate cookies in C#

System.Web.HttpCookie cookie = Request.Cookies.Get("myKey");
if (cookie!=null)
{
  var value = cookie.Value;
}


More info and samples on: www.devarchweb.net

How to create tooltip in HTML

<div title="Tooltip text">hello</div>
<span title="Tooltip text">hello</span>





More info and samples on: www.devarchweb.net