hello friends....

They have: 7 posts

Joined: Nov 2014

how can i attach javascript code into my html code in my wesite?

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

<script language="javascript" src="/path/to/file.js"></script>

or

<script language="javascript">

   // Javascript code here
 
</script>

They have: 10 posts

Joined: Nov 2013

hey you use this code

... your code ...

$(document).ready(function()
{
... your code of html ...

}
}

Megan's picture

She has: 11,421 posts

Joined: Jun 1999

That's jQuery, not JavaScript. jQuery != JavaScript. There's an extra closing bracket at the end, and I'm sure you wouldn't want to put html in there.

If you're posting code here on the forums, you can enclose it in <code> tags and it will look pretty, like this:

$(document).ready(function() {

  // This is some jQuery

});

They have: 7 posts

Joined: Nov 2014

Hello friends...
Thanks to all and thanks to 'Greg K', I am solve my problem by this..............

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.