Home > Java Script, Logic, open source products > Javascript Tips

Javascript Tips

In Javascript we can apply css as normal ,also javascript has some methods as default to support CSS.

Normal Way   : document.write(“<span style=\” color:red; \”>Vijayakumar Raja<style>”);

(or)

var text=” Vijayakumar Raja “;

document.write( “<span style=\” color:red; \>” + text +” </span>” );

Also we can use as internal css,common for same HTML Tags…

Build-in  Methods :

var text=” Vijayakumar Raja “;

document.write(txt.fontcolor(“red”));

Some of the Javascript Methods are,


toUpperCase()

toLowerCase()

bold()

Italic()

fontcolor(“green”)

fontsize(“20”)

sup()

sub()

link()

match(“Raja”)

replace(“Raja”,”Chandrasekar”)

indexOf()

lastIndexOf()

charAt()

substr()

substring()

slice()

split()

 

We can also use more than one method at a time.But,in some cases it will not work..

Example :

var text=” Vijayakumar Raja”;

text.fontcolor(“red”).fontsize(“20”).bold();

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: