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)
- 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
- How to print HTML content on click of a button, but not the page?
- Bootstrap 4 Dropdown Menu not working?
- Why is the jquery script not working?
- Textarea Auto height
- How to write inside a DIV box with javascript
- How to get height of div in px dimension
- Crop the image using JavaScript
- Force div to be topmost element of any and all webpages
- 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
- 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?
- Store JSON in a custom field
- Why does this Quick Edit checkbox save the value only when unchecked?
- 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
- How to update a meta field of type array in Gutenberg
- How to integrate my HTML and javascript into my child theme
- How to create fa-bars animated menu
- Manipulate javascript code from custom made admin page menu
- jQuery – Automatic event trigger does not **really** check my form
- Populate Javascript code with value from WordPress Custom Field?
- 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
- Overriding inline !important CSS with Javscript code snippet with media query
- 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
- Target a specific container to style on WordPress storefront theme
- How would I add this code to a single WordPress page?
- Advanced Custom Fields deleting some code and adding code for a slider
- Trouble with adding preloader to my home page index.html and index.js
- Where to find the html for WordPress site? [closed]
- how to modify a field’s size in a metabox : ROWS height, and scroll control?
- Possible jquery / library conflict in plugin usage
- Custom field in external Javascript
- CSS conditional on custom field value
- Trying to customize wordpress drop down categories
- How can I duplicate “Add Custom Field” with just JavaScript?
- Element works, but not on wordpress site [duplicate]
- Making custom pages (with an example to explain the goal)
- Interactive maps in wordpress
- Can I upload my HTML/CSS/Javascript game onto a WordPress page?
- How can I copy value from dropdown once I select it to text area as text?
- Is there a way to read JSON data inside Custom Fields without editing PHP? [closed]