Click here to Skip to main content
14,384,739 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have javascript function which working fine in all browser accept [Mozill Firefox]
work hard on it but not get any eligible result

main problem In

if (event.srcElement.getAttribute("ISDate") == "")

the main problem is to find [ISDate] from getattribute

looking for ur help

function Calendar_DateClick(event, DateId, SelectedColor, SelectedFontColor, DateBGColor, DateFontColor, AMColor, AMFontColor, PMColor, PMFontColor, UnAvailableColor, UnAvailableFontColor) {

    if (event.srcElement.getAttribute("ISDate") == "")
    var i
    switch (event.srcElement.getAttribute("ISDate")) {
        case "D":
                if (typeof (objPrevDateTD) == 'object') {
           = DateBGColor
           = DateFontColor

       = SelectedColor;
       = SelectedFontColor;
                objPrevDateTD = event.srcElement
                if (event.srcElement.getAttribute("AM") == "true") {



Updated 8-Jul-13 1:57am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

srcElement is only available in IE. In all other browsers it is target:

var target = || event.srcElement;

if(target.onclick == null) { // shorter than getAttribute('onclick')
Jimmy Darji 8-Jul-13 7:12am
i'll tried it... its not working

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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100