There are a couple of issues with what you are trying to do. See this for reference: WordPress support for Custom HTML blocks
First, you cannot reliably add JS code directly into any block, which is intended only for HTML and text. While the script tags may technically be HTML, your JS code certainly is not HTML or text. In the supplied link you see the list of supported tags and script isn’t one of them.
My suggestion would be to create a shortcode for this.
Second, for security reasons an iframe is only allowed on plug-in enabled sites. According to this, your site would need to be Business, Commerce or Enterprise. Plugin Enabled Sites
Sorry, there isn’t a quick fix.
Related Posts:
- HTML / Javascript in custom field textarea?
- Type character in name and make it invisble
- Failed to load resource: the server responded with a status of 404 (Not Found)
- Failed to load resource: the server responded with a status of 404 (Not Found)
- How can I scroll to an element using jQuery?
- Remove CSS class from element with JavaScript (no jQuery) [duplicate]
- Set cookie and get cookie with JavaScript
- What is the meaning of == $0 that is shown in inspect element of google chrome for the selected element [duplicate]
- Bootstrap Dropdown menu is not working
- Change Background color (css property) using Jquery
- Set timeout for ajax (jQuery)
- How does the data-toggle attribute work? (What’s its API?)
- CSS height 100% percent not working
- How to change css property using javascript
- Use images like checkboxes
- JavaScript Loading Screen while page loads
- Completely disable scrolling of webpage
- Bootstrap Dropdown menu is not working
- Bootstrap Dropdown menu is not working
- Uncaught TypeError: Cannot read property ‘top’ of undefined
- Full-screen iframe with a height of 100%
- How to print HTML content on click of a button, but not the page?
- Check if an element contains a class in JavaScript?
- Bootstrap 4 Dropdown Menu not working?
- Why is the jquery script not working?
- Textarea Auto height
- Why is marquee deprecated and what is the best alternative?
- Refresh/reload the content in Div using jquery/ajax
- How to write inside a DIV box with javascript
- How to get height of div in px dimension
- Crop the image using JavaScript
- Why write script type=”text/javascript” when the mime type is set by the server?
- Force div to be topmost element of any and all webpages
- Retrieve the position (X,Y) of an HTML element
- How to display raw JSON data on a HTML page
- how to display a div triggered by onclick event
- Why is jquery show() not working in example
- jQuery scrollTop() method not working
- Change an image with onclick()
- JavaScript – Count Number of Visitor for Website
- Creating Accordion Table with Bootstrap
- Fully responsive HTML5 video
- How to create a hidden
in JavaScript?
- How to create checkbox inside dropdown?
- Positioning element at center of screen
- Adding Google Translate to a web site
- Cannot read property ‘style’ of undefined — Uncaught Type Error
- How to make HTML element resizable using pure Javascript?
- How to use aria-expanded=”true” to change a css property
- How to set “style=display:none;” using jQuery’s attr method?
- How do I clear the content of a div using JavaScript?
- Local wordpress install only shows home page, all other pages Not Found
- WordPress Bootstrap Handburger Menu Wont Open
- Validating Custom Meta Box Values & Required Fields
- Using TinyMce with textareas in meta boxes on custom post types
- How can I fetch CSS from JSON WP REST API response
- Unable to get Preview of Uploaded image within a Custom Meta box
- Custom per-page sidebar widgets .. possible?
- getEntityRecord without knowing the post type
- Store JSON in a custom field
- Why does this Quick Edit checkbox save the value only when unchecked?
- Minify HTML, CSS, JS with PHPWee?
- How to save a ToggleControl value in a meta field?
- Inserting Schema Markup (JSON-LD) Manually with Custom Fields or any Better Ways?
- Write text below a specific part of a sentence
- Show post in slider
- How to update a meta field of type array in Gutenberg
- How to insert html/css/javascript code to wordpress plugin
- How to integrate my HTML and javascript into my child theme
- How to create fa-bars animated menu
- Add new image block, set default class name and update it using Javascript
- Manipulate javascript code from custom made admin page menu
- jQuery – Automatic event trigger does not **really** check my form
- Redirect to another page using contact form 7? [closed]
- Populate Javascript code with value from WordPress Custom Field?
- How can I get the search form to be selected automatically?
- Add Codepen animation as Preloader to WordPress
- Cannot set property ‘className’ of null at setThemeFromCookie
- Adding a Calculator to a WordPress Page
- How to Add a Read-only Textbox With Text in it That Has a Button to Copy it?
- Link to page with posts of specific type
- How to style posts selecting a CSS post_class (added through custom_fields?)?
- How to add a css class to custom field value?
- prevent HTML output if custom field is empty [closed]
- using advanced custom field to control css hover color
- Meta field bulk editing no longer working in WP 6.0 [closed]
- Filter post style attribute
- get_field values for each post on home page using wp_add_inline_style
- Hide Tab Titles from Tabs Block
- Add other class content with reference class value
- HTML for adding a meta box (basic text field) to page editor?
- Overriding inline !important CSS with Javscript code snippet with media query
- Landing Page with HTML CSS JS and Images on wordpress
- How to make wocommerce shop products same heigt
- General Term for this form Field
- Unable to use Datepicker in a table when inserting a row
- WordPress Slider is not working
- Getting click on item to open closest relevant element (popup) with jQuery
- jQuery for Fade Preload Causes My Site Favicon to Disappear from Tab of Browser
- Hide CSS class only in single post pages