I have tried the following code to add href to the a tag inside a td. it is working fine while i do in console. But when I try the same in my code it is not working. Can anyone
Your code executes before the DOM is ready and the element actually exists, try it this way:
The reason it works on console is because the element already exists when you execute your code...
JSBin Demo