jQuery

Default text for an input field:

function populateElement(selector, defvalue) {
    $(selector).each(function() {
        if($.trim(this.value) == "") {
            this.value = defvalue;
        }
    });
 
    $(selector).focus(function() {
        if(this.value == defvalue) {
            this.value = "";
        }
    });
 
    $(selector).blur(function() {
        if($.trim(this.value) == "") {
            this.value = defvalue;
        }
    });
 }
populateElement('#SearchText', 'Enter your search term here..')

var jiathis_config = { url: ""}
$('a.jiathis').mouseover(function(){
    jiathis_config.url = $(this).attr("addthis:url");
});
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License