I understand this part. But still does not answer my question. Thank you.
>A page is not sent back to the server. that is, the html, javascript, and css are never sent back to the server. The data in the form is sent back.
>
>
>>Do I understand that if you add an element (e.g. div of id="test") in the script section of the page, and then the page is sent back from the server (posted back) this element no longer exists? That is, I cannot use this element in the IF statement of the javascript?
>>
>>For example, I want to call a certain method of the page but only One Time. And I was doing the following (which does not seem to work):
>>
>>
>> if ($('#Test').length==0) {
>> // div of ID Test does not exist.
>> // create this div
>> var $div = $('<div />').appendTo('body');
>> $div.attr('id', 'Test');
>> // Call button click method.
>> document.getElementById("btnTest").click();
>> }
>>
>>
>>The above seem to go into an endless loop.
>>
>>Any suggestions? TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham