There’s nothing wrong with your code, other than it needs to be executed
after the DOM is ready. You can put the script after the table or use .ready() | jQuery API Documentation
.
The statement what i have added is already part of function. I have
added part of my code snippet. When i execute the code I'm getting
the alert dialogue but the next line which adds the row isn't working.
I was adding empty td elements and checking from the page source
after it is loaded which shows nothing. Now I fugered it out how
dynamic addition works with jQuery:)
I actually laughed out load. So many new programmers do that! "View
Source" is nice, especially if you use a server language to
generate the page. But the "Web inspector" / "Dev
Tools" is KING!