How to get html source code from body field in node type edit form?

by Sugandh Khanna   Last Updated January 11, 2018 11:07 AM

In node type = "article", I have field of type body.

enter image description here

In my .module file, I want to get its raw source code with actual html classes too. But all I get is:

enter image description here

$body = $node->get('field_all_body')->value;

I want the value should contain div class too. How it can be achieved?

My actual requirement is: I want to populate one field value on behalf of the class exists in 'field_all_body' field.

Foe example, I select some text in text-editor, and mark it bold, then that particular text should get cloned in another field too.

Tags : 8 nodes

Related Questions

Disable read more link

Updated March 26, 2015 14:02 PM

Node Cancel Button?

Updated May 26, 2015 03:03 AM