Title: &amp;&amp; produces error
Last modified: December 27, 2022

---

# && produces error

 *  Resolved [nicewp123](https://wordpress.org/support/users/nicewp123/)
 * (@nicewp123)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/produces-error/)
 * Hi! When I use && in my JS code (in Custom HTML block), it produces error “Uncaught
   SyntaxError: Invalid or unexpected token (at (index):1577:1232)”. In console 
   I see that, && was converted to “& # 038;& # 038;” and the error is pointing 
   on it. How to disable this autoformatting? Please let me know, thanks!
 * UPD: ( x<y && z>w) produces error, but (z>w && x<y) doesn’t.
    -  This topic was modified 3 years, 5 months ago by [nicewp123](https://wordpress.org/support/users/nicewp123/).
    -  This topic was modified 3 years, 5 months ago by [nicewp123](https://wordpress.org/support/users/nicewp123/).

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

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [3 years, 5 months ago](https://wordpress.org/support/topic/produces-error/#post-16323624)
 * JS is executable (interpretable actually) code, it’s not HTML, even though it’s
   within a `<script>` block. All editor HTML is encoded with `htmlspecialchars()`,
   so you cannot reliably place JS in any editor block. In the right context it 
   can work, but it’s not reliable. To reliably place JS on a page, it could be 
   inserted by a custom shortcode or block that does not use `htmlspecialchars()`.
   Or you could use `wp_add_inline_script()` or use a plugin specifically meant 
   for inserting JS onto pages.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [3 years, 5 months ago](https://wordpress.org/support/topic/produces-error/#post-16324055)
 *  Also make sure you’re an admin or editor level user. Lesser user levels don’t
   have the privilege of posting unfiltered HTML.

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

The topic ‘&& produces error’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 3 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [3 years, 5 months ago](https://wordpress.org/support/topic/produces-error/#post-16324055)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
