Jump to content

Hidden text in 1 area moves & displays in another


METOOTECH

Recommended Posts

Hi again, it gets worse each time I post.... Now I need to hide text in one area and when thumbnail photo or button is clicked on the text is moved to the display area and made visible. I'm totally baffled here on this one.... here's the code I had for it and it, of course, doesn't work.... I think I'm wayyyyy off here... any help is always appreciated very much... METOOTECHTHE CODE:<div id="d" style="display: block">TEXT YOU CAN SEE <div><br><div id="d2" style="display: none"> want hidden text below here </div><div id="d3" style="display: none">TEXT YOU CANNOT SEE</div><button id="b1" onclick="d2.style.display='block'; document.d3='document.d2'">CLICKER</button>I forgot to say, that when refreshed everything is hidden again and there will be more than one of these hidden text things so when new one is clicked on, the old one is replace with the new one, etc. .... Metoo.

Link to comment
Share on other sites

Gee wizz i don't know if i quite understood that but here goes. :)

Now I need to hide text in one area and when thumbnail photo or button is clicked on the text is moved to the display area and made visible.
I think this is what you asked for, you can access the text of a element by using innerHTML you you can pass values around.
<div id="d" style="display: block">TEXT YOU CAN SEE <div><br><div id="d2" style="display: none"> want hidden text below here </div><div id="d3" style="display: none">TEXT YOU CANNOT SEE</div><button id="b1" onclick="d3.innerHTML=d2.innerHTML;d3.style.display='block';">CLICKER</button>

If you are doing this more than once though then i think you should create a function and let it do all the work.

Link to comment
Share on other sites

No, not exactly it. I guess I didn't make it clear enough in my statement to what I am trying to do here :) The red text part in my original code was just a comment or place holder, not in the code results.... I will have a display area, in that display area will be a place for a photo to display and right below it will be a place for text to display. On load the photo display area will have a Logo sitting there with no text showing below. And beside this display area will be a list of products. With each product a link to the display area with hidden photo and hidden text. When one of the products is click on the display area with the Logo and no text will be replaced with the hidden photo and hidden text.... right now I'm using a textarea statement to accomplish this... the textarea tag does not allow much latitude for text decoration and I was trying to replace it with the code below... METOOTECH :)PHOTO <br><div id="d2" style="display: none">-0-</div> This division code is where the hidden text (TEXT YOU CANNOT SEE) will display<div id="d3" style="display: none">TEXT YOU CANNOT SEE</div> This is the hidden code in another part of the page<button id="b1" d2.text='d3.text'; onclick="d2.style.display='block'">CLICKER</button> This is the code that puts the hidden code right above in the top area

Link to comment
Share on other sites

Gee wizz i don't know if i quite understood that but here goes.Ā  :) I think this is what you asked for, you can access the text of a element by using innerHTML you you can pass values around.
<div id="d" style="display: block">TEXT YOU CAN SEE <div><br><div id="d2" style="display: none"> want hidden text below here </div><div id="d3" style="display: none">TEXT YOU CANNOT SEE</div><button id="b1" onclick="d3.innerHTML=d2.innerHTML;d3.style.display='block';">CLICKER</button>

If you are doing this more than once though then i think you should create a function and let it do all the work.

This code doesn't work when I put it on a html doc.... when the button is clicked the d2 comment in red displays, not the innerHTML of the d3 hidden text :)
Link to comment
Share on other sites

This code doesn't work when I put it on a html doc.... when the button is clicked the d2 comment in red displays, not the innerHTML of the d3 hidden text :)

Ok, I fixed it to work :) I changed the d3.innerHTML=d2.innerHTML part of the code to d2.innerHTML=d3.innerHTML in other words I swapped the order and now it works.... YOU ARE A GENIUS
Link to comment
Share on other sites

I plugged the code in and it works like a charm... the textarea tag didn't allow much text decoration. this does!..... as I said, this will go on eBay and only inline stuff makes past the "eBay Police" and their text editor.... and remember I'm trying to sell things here and presentation is important... "you ain't got a thing, if you ain't got that swing" .... I know.... I'm talking to myself... :)Much thanks for your help, so far! :) .... From "across the pond" .... METOOTECH

Link to comment
Share on other sites

Ah yes i forgot about the inline only stuff, i must say this looks realy impressive for an ebay pageĀ 
Thanks, ....It will be part of an ebay "About Me" page where people can preview things that will go on auction sooner or later and also, they can email me and I will put it on auction "Buy it now" for them........ METOOTECH
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...