At a basic level, treat the jQuery selector syntax as if you were adding a CSS selector and you won't go far wrong.
On May 7, 1:36 pm, Leonardo K <leo...@gmail.com> wrote: > You need to use the simbol # before the name of ID. > > $( "#myDiv" ).css('left', '150px'); > > On Wed, May 6, 2009 at 22:22, ace jquery <acejqu...@gmail.com> wrote: > > Hi there, > > > I am trying to move the div object, but it seems doesn't work. any ideas? > > Thanks > > > <script language="javascript"> > > > $(document).ready(function () { > > > $("<div/>" ) > > .attr( "id", "myDiv") > > > .addClass( "header" ) > > > .html( "hello world") > > > .appendTo( $( "body" ) ); > > > $( "myDiv" ).css('left', '150px'); > > > }); > > </script>