Hope You can use fallowing
// Sets class attribute on all paragraphs in the active editor
tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass');
// Sets class attribute on a specific element in the current page
tinymce.dom.setAttrib('mydiv', 'class', 'myclass');
or You can add Id by jquery like this
$('div').find('p').attr('id', 'myid');
Related Posts:
- Adding Custom Text Patterns in the WP 4.5 Visual Editor
- Bridge WordPress Media API with custom tinyMCE plugin [closed]
- Asynchronously render shortcodes in TinyMCE visual editor
- Add a select option of shortcodes like dropdown in tinymce
- Translate MCE button text/tooltip in custom plugin
- How to close tinymce inline popup
- Add Button to TinyMCE Custom Menu
- Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1
- Add self-closing shortcode button to TinyMCE in WP 4.6
- How to provide translations for a WordPress TinyMCE plugin?
- API to trigger prompt on leaving page
- Hook the Keydown Event in the TinyMCE Post Editor
- Utilize TinyMCE hyperlink chooser outside of TinyMCE
- Making a custom widget that includes a tinymce and works in Site Origin Page Builder
- How can I find the ‘public absolute’ path of a file?
- WYSIWYG editor in WP 3.2 plugin
- Show dialog box in TinyMCE plugin and use WordPress php functions in it
- the_editor() function
- TinyMCE 4.7.11 custom styles using styleselect – what does the ‘attributes’ argument do?
- Rich text editor settings persist throughout all rich text editors
- WP Editor Issue in Backend
- Open modal when user clicks on span in visual editor
- tinymce.get() returns error after ajax request
- TinyMCE editor turns white on Biographical info [closed]
- Inserting code to HTML view from a pop up initiated from visual view
- Moving/dragging a metabox removes TinyMCE’s content
- Can I Hook Into the TinyMCE Insert/Edit Link Button to Use Shortlink For Post?
- How can I allow the user to press enter without creating a new element in the editor?
- How to display TinyMCE HTML view?
- Multiple TinyMCE on button click is initialized and appended but why only last one is writeable?
- TinyMCE 4.7.11 – Enable hidden WordPress core plugins? (referencing a wp-includes from plugin.php)
- How to get values from Tinymce visual editor popup?
- TinyMCE how to add css when inputing a text
- get_option() is undefined in TinymceWindowManager
- Issue with iframe in TinyMCE
- Why if i enqueue the tinymce script i get undefined error
- add_action hook for completely new post?
- Is get_option function cached?
- How to include jQuery and JavaScript files correctly?
- How do I log plugin (cron) actions?
- Adding pre-publish checks with Gutenberg
- Problems after wp_set_password() containing an apostrophe
- Error getting correct blog_id on MU from functions.php
- Determine which theme location a wp_get_nav_menu_items is for
- How to use wp_set_password in a plugin?
- Endpoint on Specific Page Slug
- How can I free up the memory used by update_post_meta?
- add javascript button to order place button
- URL rewriting must be activated manually for my plugin
- how to activate plugin network-wide, and save setting across sites
- PHP logging framework to be used with WordPress
- What is difference between blog id and site id?
- How to Load Plugin JS in theme’s footer section
- PHP 7 – Class Method Compatibility Issue
- Change reset password URL returned by wp_lostpassword_url() via plugin
- wp_transition_post_status does not change the status of the post
- Add notification bubble notice in navigation using transients
- How to print raw query from WP_Query class just like in CodeIgniter
- Custom plugin – $post_id in wp_head
- Is it safe to call do_action and apply_filters for built-in hooks?
- Creating a Link Text like Submit Button in Admin Page
- wordpress plugin php file processing form
- 403 Error when text is pasted in Custom Metabox Textarea
- How To Change Post Author Default?
- is it recommended to use WP_List_Table?
- Multiple Plugin best practice in Multisite
- How to extend WooCommerce API to show bookable product availability rules?
- Adding a colorbutton in tinymce dialog with current api
- Enumerating shortcode attributes in JavaScript
- Delist entries in the_loop
- wordpress add_submenu_page adds broken link
- Uploaded attachment not set as featured image
- WordPress – manually relate a post to page(s)?
- How to use apiFetch to get author information in Gutenberg properly?
- Gutenberg blocks error: Each child in a list should have a unique “key” prop
- Can we use a library under MIT license in a WooCommerce plugin?
- Soap web service request from wordpress plugin
- Why does comments_open() return false when publishing a scheduled post?
- Use options to control jQuery plugin
- Including template in shortcodes
- Is there anything special required to make a plugin work in a multisite environment?
- How to exclude categories from get_categories() select list inside a widget admin panel
- WordPress plugin development theme issue
- Using custom IDP with WP
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- Securing custom rest API endpoints with public access from PWA
- WordPress5.2.3: Better File Download Plugin validation issue
- How do I make secure API calls from my WordPress plugin?
- esc_attr() on hard coded string
- Creating a return url for getting data from external api
- How to stop TinyMce from converting image url into ?
- Is it possible to restore an expired transient?
- How to Maintain url on form submit
- Experts opinions needed: How (in)secure is this approach?
- WP API users per page
- action callback, for action dispatched as reported by hook sniffer, not called
- variable created in page.php is null inside of header.php
- Access WordPress Tag Function From Modal
- how can I insert a link on login page
- Programmatically creating posts based on external JSON feed (asynchronously)