1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Rep Power

    Post Java line paragraph & line breaks

    I am new to Java and was wondering if someone might be able to guide me in the right direction. I am using the following on an XHTML doc type and get the following errors on validation, what alternative is correct?

    document type does not allow element "br" here


    <script type = "text/javascript">
    document.write ("Display text goes here<br/>Second line here <br/><br/>Third line here or new paragraph");

    Also how would I show a word in bold or italics, for example HTML equivilent of <i>word</i> or <b>word</b>

    Thank you for you support...
  2. #2
  3. --
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2012
    Rep Power

    this is JavaScript, not Java. Those are two completely different languages. They have nothing to do with each other except that they share the first few characters of their name. "Java is to JavaScript as ham is to hamster".

    I'll ask a moderator to move the topic.

    The next problem is that XHTML is very different from "normal" HTML (which is something most people don't realize). Don't use XHTML unless you know exactly what you're doing. It's not "the new and better HTML" or something.

    What you want is plain HTML:

    <!DOCTYPE html>
    Then your validation issues will go away.
    The 6 worst sins of security ē How to (properly) access a MySQL database with PHP

    Why canít I use certain words like "drop" as part of my Security Question answers?
    There are certain words used by hackers to try to gain access to systems and manipulate data; therefore, the following words are restricted: "select," "delete," "update," "insert," "drop" and "null".

IMN logo majestic logo threadwatch logo seochat tools logo