How Do I Put An HTML Image Code In A Scroll box With Only The HTML Text Showing And Not The Image?

I Am Trying To Put A Scroll Box On My Myspace And What I Want To Put In The Scroll Box Is An Image HTML Code. But I Want The Scroll Box Only To Show The HTML Text Not The Image When It Is On My Profile. Does Any Body Know A Website Where The Scroll Boxes Do Not Show HTML Images Or How To Fix This?

Update:

I'm Sorry To Say But None Of The Answers I Got So Far Helped Me. I Tried The One With The Pre And The Image Still Came Up. Then I Tired To Text Area And Pre One And It Didn't Even Show Up. Payne I Tried Yours But When People Copy And Paste The HTMLCode The Image Wouldn't Come Up. I Wanted The Image To Come Up After They Copied The Code. That's Why I Only Wanted The Text To Show So They Can Copy And Paste It.

6 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Nobody has a clue how to do this!!!!

    How to put HTML code in a textarea or scroll box:

    You MUST deactivate the HTML code by making it appear as text in whichever box you use. The code I show below WILL work as it's been tested.

    Change all the opening tag symbols, "<", to the character entity, & lt ; (without spaces). & lt ; (without spaces) = <. This will deactivate the HTML code in the textarea/scroll box, but allow users viewing the page to copy/paste the code.

    Example:

    <textarea style="background: transparent;" rows="8" cols="70"> & lt;img style="width: XXpx; width: YYpx; border: 0; src"pic link" alt="Text Description"> </textarea> There is no closing tag for the image tag unless you are using an XHTML DocType then the image tag is closed with a space an a "/": " /". Example:

    & lt;img style="width: XXpx; width: YYpx; border: 0; src"pic

    link" alt="Text Description" /&' gt;

    &' lt; with out spaces = <

    &' gt; without spaces = >

    Ron

    • Commenter avatarLogin to reply the answers
  • 4 years ago

    You probably mean a 'textarea'. And what you want to do is called 'escaping'. If you are using PHP, you can call <?php echo htmlspecialchars($data); ?> inside the textarea tags. If not, then you get to have fun with Javascript to do string replacements.

    • Commenter avatarLogin to reply the answers
  • skahoj
    Lv 5
    1 decade ago

    Why are you putting an image code if you don't want the image to show up? Put the text code only.

    • Commenter avatarLogin to reply the answers
  • Anonymous
    1 decade ago

    You will need to add the <pre> tags around the code that you do not want the browser to parse. For example:

    <textarea>

    <pre>

    <img src="somepic.jpg" alt=""somepic">

    </pre>

    </textaread>

    Stephen Williamson, Server Engineer, http://www.HostMySite.com?utm_source=bb

    • Commenter avatarLogin to reply the answers
  • How do you think about the answers? You can sign in to vote the answer.
  • 1 decade ago

    The proper way to do this is to wrap the code you want to display with the following tags:

    <pre>

    Code here

    </pre>

    Source(s): I'm the creative director for a creative design agency. http://newbirthcreative.com/
    • Commenter avatarLogin to reply the answers
  • Anonymous
    1 decade ago

    You could try <-- a href="whatever.gif" -->

    the <-- --> tells the browser that what is in between <-- and --> is a comment.

    • Commenter avatarLogin to reply the answers
Still have questions? Get your answers by asking now.