Javascript $ find returns null in IE

I am using the AJAX Control Toolkit "TextBoxWaterMarkExtender". The original problem was that in Firefox, setting the text using javascript as follows:

var getDateField = document.getElementById('soandso');
getDateField.value = 'someandsome';

It will be cleared on submit / post because the Extender control decided that no one had edited it, so it cleared the watermark.

I followed this workaround: http://www.mindfiresolutions.com/Workaround-for-TextBoxWatermarkExtender-of-AjaxControlToolkit--855.php

and it works fine in Firefox, but IE says that "null" is null or not an object "on this line:

var dateIdentified = $find("Beh" + sender).get_Text();

Anything obvious that I'm missing?

Edit: Sorry guys, I thought $ find is a jQuery function.

: :

function dateToday(sender)
        {
            var dateIdentified = $find("Beh" + sender).get_Text();
            if (dateIdentified.length == 0)
            {
                var todaydate = new Date();
                var smonth = todaydate.getMonth() + 1;
                var sday = todaydate.getDate();
                var syear = todaydate.getFullYear();
                $find("Beh" + sender).set_Text(smonth.toString() + '/' + sday.toString() + '/' + syear.toString());
            }
        }

WaterMark:

<toolkit:TextBoxWatermarkExtender BehaviorID="BehSTART_DATE" ID="WaterMarkSTART_DATE" runat="server"  
 TargetControlID="dcSTART_DATE"
 WaterMarkText="mm/dd/yyyy" WaterMarkCssClass="searchHint" /> 
+3
2

, , body onLoad, javascript

Sys.Application.add_load(MyFunction);

: http://blogs.telerik.com/dimodimov/posts/08-12-13/don_t_use_body_onload_in_asp_net_ajax_websites.aspx

IE, Firefox Chrome $find.

+3

:

$("Beh" + sender).text();

find() , , . , , foo, :

var myTable = $('#myTable');
// more code
myTable.find('.foo');
+1

All Articles