The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Embedding an image?

3 posters

Go down

Solved Embedding an image?

Post by notMicElf August 30th 2009, 2:24 pm

Hey, well I've got a code that opens new content upon click

Spoiler:

The problem is I need to put images in it. I've used the <img src="image url here"> code, it works on the first text area, but not the second, as the img code apepars to interfere with the input type code. Does anybody know how to make both "text" & "newtext" contain images?


Last edited by notMicElf on August 30th 2009, 11:28 pm; edited 1 time in total
notMicElf
notMicElf
Forumember

Male Posts : 377
Reputation : 0
Language : English, HTML, CSS, Java
Location : Not where you are =P

Back to top Go down

Solved Re: Embedding an image?

Post by ProgVal August 30th 2009, 4:17 pm

Hello,

Try that:
Code:
<script type="text/javascript">
function myFunction()
{
  document.getElementById('a').innerHTML='newtext';
}
</script>
<span id="a">text</span><br>
<input type="button" value="Click" onclick="myFunction();"/>
Replace "newtext" by your text. If you want to use this caracter: ' put a backslash before (the backslash is: \ )

Cordially,
ProgVal
ProgVal
ProgVal
Forumember

Male Posts : 80
Reputation : 10
Language : French; learning English
Location : France/Moselle/On my PC

http://aide.1fr1.net

Back to top Go down

Solved Re: Embedding an image?

Post by notMicElf August 30th 2009, 11:25 pm

ProgVal wrote:Hello,

Try that:
Code:
<script type="text/javascript">
function myFunction()
{
  document.getElementById('a').innerHTML='newtext';
}
</script>
<span id="a">text</span><br>
<input type="button" value="Click" onclick="myFunction();"/>
Replace "newtext" by your text. If you want to use this caracter: ' put a backslash before (the backslash is: \ )

Cordially,
ProgVal

Thankyou, that code worked like a charm and performed the task I needed it too. Smile
notMicElf
notMicElf
Forumember

Male Posts : 377
Reputation : 0
Language : English, HTML, CSS, Java
Location : Not where you are =P

Back to top Go down

Solved Re: Embedding an image?

Post by RoNo August 31st 2009, 12:00 am

Options: This will give your button 1st and 2nd images
Spoiler:
Use this if you want the 2nd image to be clickable/linked
Spoiler:



Since the issue appears to be resolved, I will lock this topic.

Embedding an image? Locked1 Embedding an image? Lock2
RoNo
RoNo
RoNo
Active Poster

Male Posts : 1270
Reputation : 135
Language : English
Location : Laguna Beach, California

http://bf2mercenaries.forumotion.com/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum