Hi before adding <!DOCTYPE html > to my html, my javascript code is working fine. But by adding this to my html, the below part of the code is not working

div.style.left=x;
div.style.top=y;

i am not able to set left and top values to an element. What could be the problem?

I found the mistake. I have to add "px" not the numbers. Thank you so much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.