Below is the simple and a short code to change or set the background color of item in menu onclick or active tab of menu (i.e. li of ul) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>List Item</title> <style type="text/css"> ul { list-style-type:none; float:left; border-bottom: solid 2px Red; padding-right:40px; } ul li { float:left; width:auto; padding:8px; display:block; cursor:pointer; } </style> <script type="text/javascript" language="javascript"> function checklist(ctrl) { ...
This one is from the interview question I have asked. A sequence was given to me and asked to write a SQL query to find the difference pattern of the sequence and complete the sequence by adding missing numbers. Give sequence: '1,5,13,21,25,29,41' Below is the query to find the answer: SET NOCOUNT ON DECLARE @temp AS TABLE ( Id INT IDENTITY , Nums INT , NextNum INT DEFAULT 0 , Pattern AS ( NextNum - Nums ) ) INSERT @temp ( Nums ) SELECT * FROM dbo . Split ( '1,5,13,21,25,29,41' , ',' ) -- Here assume that Split function you have added already OR please follow the link -- http://anishrana.blogspot.in/2012/03/split-string-in-sql-server-using-xml.html -- and create one. UPDATE a SET NextNum = b . Nums FROM @temp a JOIN @temp b ON a . Id = ( b . Id - 1 ) DECLARE @pattern INT = NULL, ...
JavaScript Code To Retrieve Query String Values This topic shows you how you can retrieve the query string values from a URL using JavaScript. The code is simple and understandable. Below is the complete code. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Query String using Javascript</title> <script type="text/javascript" language="javascript"> function getquerystring() { var qsarr = new Array(); var qs = location.search.substring(1); var singleqs = new Array(); var str =""; qsarr = qs.split('&'); ...
Comments
Post a Comment