0

how do I get the css and the html into the function?

<html>
<head>
<script type="text/javascript">
function myFunction()
{
return ("Hello world!");
}
</script>
</head>
<body>
<div style="float:right;">
<script type="text/javascript">
document.write(myFunction())
</script>
</div>
</body>
</html>
2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by niche1
0

I think here is your answer..

<html>

      <head>

      <script type="text/javascript">

      function myFunction()

      {

      return ("<h1 style='color:red;background-color:gray'>Hello world!</h1>");

      }

      </script>

      </head>

      <body>
        <div style="float:right;">
        <script type="text/javascript">

      document.write(myFunction())

      </script>

      </div>
        </body>

  </html>

Edited by pyTony: fixed formatting

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.