CSS question - DIV content change on hover

Out of context: Reply #7

  • Started
  • Last post
  • 13 Responses
  • section_0140

    Javascript is your answer.

    Use a document.querySelector() to grab a reference to each div you want to hide.

    On hover hide one and show the other. As far as the title you can do the same thing. except you'll be replacing the "innerHTML" of that element.

    I realize this is an abstract reply, but it's the best way to do it.

    • no need though when it can all be done in CSS which I know it can. But thanks.fadein11
    • The "need" is more a matter of opinion. Personally, I prefer to do dynamic DOM manipulation through javascript. Especially when projects get larger.section_014
    • But, whateva floats your boat!section_014
    • yep I know what you are saying - just no need to get into that detail as I knew it could be done with CSS alone. But thanks again.fadein11

View thread