Click here to Skip to main content
12,954,856 members (64,129 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

9.4K views
1 bookmarked
Posted 11 Feb 2012

Trim, Mouse Hover Pointer Functions using JAVASCRIPT

, 11 Feb 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
Trim, Change button mouse hover pointer Functions using JavaScript

Trim Function


Function: trim
Input : ' Test Trim Function ', ''
Output: 'Test Trim Function'
Example:
trim(document.getElementById(varUB).value, '')

function trim(str, chars) {
    return ltrim(rtrim(str, chars), chars);
}
function ltrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
function rtrim(str, chars) {
    chars = chars || "\\s";
    return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}


Change Button Mouse Hover Pointer


Input: Button control client id
Example:
<asp:Button ID="btnSubmit" runat="server" Text="Submit" OnMouseOver="onMouseOver(this);" OnMouseOut="onMouseOut(this);" />
function onMouseOver(btnCntl) {
    btnCntl.style.cursor = 'hand';
}
function onMouseOut(btnCntl1) {
    btnCntl1.style.cursor = 'default';
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ramanujam Shankar
Web Developer Mahindra Logisoft Business Solution Limited, Chenn
India India
No Biography provided

You may also be interested in...

Pro

Comments and Discussions

 
-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 11 Feb 2012
Article Copyright 2012 by Ramanujam Shankar
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid