Mar
6th

COLSPAN and ROWSPAN Tutorial

Files under HTML & CSS | Leave a Comment

Every webmaster also know that table cells can be spanned more than one column or row. The attribute of ROWSPAN is used to make cell span multiple rows. If let say ROWSPAN=”3″ it will only span a column vertically across three rows.

<table border=”1″ cellspacing=”2″ cellpadding=”2″ width=”200px”>
<tbody>
<tr>

<td>Codebasic.net</td>
<td rowspan=”2″>spanned</td>
<td>myLengLui.com</td>
</tr>
<tr>
<td>
imDavidLee.com</td>
<td>LifeTechie.com</td>
</tr>
<tr>

<td>LimPek.com</td>
<td>innoDesigner.com</td>
<td>PenangBlogger.com</td>
</tr>
</tbody></table>
Codebasic.net spanned myLengLui.com
imDavidLee.com LifeTechie.com
LimPek.com innoDesigner.com PenangBlogger.com

The COLSPAN attribute is to make a cell span multiple columns. It spans the columns and will make your table cell span horizontally.

(more…)

Feb
5th

How To Find Length of String In Javascript?

Files under Javascript | Leave a Comment

While working with strings, most probably we will need to find a length of string, count of charachers and etc. In JavaScript we can make use of the string related function as the [variable].length

So, here we go!! I decided to share some really basic source code. Here’s the example shows in an alert dialog box with the length of the string “My Name is David”

var mystring = “My Name is David”;
alert( mystring.length );

(more…)

Jan
30th

Change Mouse Pointer Using CSS

Files under HTML & CSS | Leave a Comment

There are certain scenarios where you want to change the mouse cursor when you hover over a link. By the way, when you do such a thing you put some javascript in the onclick event and with that you want to give the user a feeling that he/she’s clicking on a hyperlink.

Do you know how to change mouse pointer using CSS? Well, it’s simple and easy. This is the basic cursor type that we normally used:

i) default – Display the normal mouse pointer icon

ii) wait – The mouse icon to represent “processing”

iii) crosshair – A plus symbol

iv) text – An “I” shaped icon that is displayed when selecting text

v) pointer - A hand icon that you see when you hover

vi) help – A question mark

x) move – A cross mark

(more…)

Jan
23rd

Javascript Remove Blank Space In Text Field

Files under Javascript | Leave a Comment

This tutorial will help you to remove spaces in a text field using Javascript. Any spaces keyed in by the user will be removed when they click on the button or anywhere outside the text field.

javascript_remove_space

This string.split() is to find all the substrings in a string that are separated by one or more characters. Then, i used string.join() to join a sequence of strings.

My Sample of Codes:

You can try to copy and paste into a notepad and save it as .html to test and see the result.

(more…)

Jan
16th

Convert String to Lowercase In Javascript

Files under Javascript | Leave a Comment

Now you can learn how to convert to lower case letters by using toLowerCase() functions in JavaScript. So, in order to convert a string to lower case, then you need to call the toLowerCase() method on the string.

tolowercase

The toLowerCase() method will return a lower case string into a new text field called “output”.

Sample Code of Converting String to Lowercase

Place this code inside the head section.

<script>
function toLowercase() {
document.form.output.value = document.form.input.value.toLowerCase();

}
</script>

Place this code inside the body section.

(more…)