Title: Mouse hover effect code problem in TEXT mode
Last modified: August 22, 2016

---

# Mouse hover effect code problem in TEXT mode

 *  Resolved [gond78](https://wordpress.org/support/users/gond78/)
 * (@gond78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/)
 * Hello,
 * I’m trying to set a mouse hover effect in my Home page content using this code
   in TEXT view :
 * [<img src=”URL OF FIRST IMAGE GOES HERE” onmouseover=”this.src=’URL OF SECOND IMAGE GOES HERE'” onmouseout=”this.src=’URL OF FIRST IMAGE GOES HERE'” />](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/TARGET URL GOES HERE?output_format=md)
 * When I do a “preview changes” it works great, no problem there so I go and I 
   update the content.
 * The problem comes then, when I go back to VISUAL mode.
    The code I put in TEXT
   mode disappears when I switch back between TEXT and VISUAL mode for no reason,
   and only keeps the fist line of the code, with the image and the link.
 * Any idea why?
 * Thanks

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Thread Starter [gond78](https://wordpress.org/support/users/gond78/)
 * (@gond78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378838)
 * sorry got the code wrong in my first post, this is what I put
 * `<a href="TARGET URL GOES HERE"><img src="URL OF FIRST IMAGE GOES HERE" onmouseover
   ="this.src='URL OF SECOND IMAGE GOES HERE'" onmouseout="this.src='URL OF FIRST
   IMAGE GOES HERE'" /></a>`
 *  Thread Starter [gond78](https://wordpress.org/support/users/gond78/)
 * (@gond78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378908)
 * any idea? 🙂
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378909)
 * Why do you need to switch between the two tabs?
 *  Thread Starter [gond78](https://wordpress.org/support/users/gond78/)
 * (@gond78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378913)
 * well for editing purpose, in visual mode as far as I know there is no way to 
   set a mouse hover effect.
    only by editing in text mode with the code I linked
   above you can set it up.
 * Once I have written my code I then switch back to visual mode to edit my content(
   easier to do that way obviously) but if I edit any content then update my page,
   for no reason the mouse hover code I entered in text code is being deleted (I
   realized that because the mouse hover wasn’t working anymore so I went back to
   text mode to check and that is when I saw it wasn’t there anymore)
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378915)
 * There has always been an issue with code being stripped out when you toggle between
   the two tabs. I think you’re supposed to Preview the changes instead.
 *  Thread Starter [gond78](https://wordpress.org/support/users/gond78/)
 * (@gond78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378917)
 * when I preview the changes it works, but eventually I have to switch back to 
   visual mode at some point in my editing and save the changes, that’s where the
   bug appears :S
 *  Thread Starter [gond78](https://wordpress.org/support/users/gond78/)
 * (@gond78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378928)
 * as you said it’s a problem of code being stripped out when switching modes.
    
   there is [that apparently fixes the problem so I’ll give it a try](https://wordpress.org/support/view/plugin-reviews/preserved-html-editor-markup-plus)
 *  Thread Starter [gond78](https://wordpress.org/support/users/gond78/)
 * (@gond78)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378929)
 * it worked! the code isn’t being stripped out anymore.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Mouse hover effect code problem in TEXT mode’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 2 participants
 * Last reply from: [gond78](https://wordpress.org/support/users/gond78/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/mouse-hover-effect-code-problem-in-text-mode/#post-5378929)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
