'Intercepting innerHTML and execution other command

Is it possible to somehow intercept element.innerHTML = msg; in one particular location and run it:

$("#id").text(msg);

instead of .innerHTML = msg?

http://jsfiddle.net/j8b4zoLt/

UPDATE:
I've found the similar question: how to intercept innerHTML changes in javascript?
and as I understand the interception innerHTML is not possible.



Solution 1:[1]

This code should work

insertIntoMsgBox = function(msg) {
  //...
  var element = $('.msgContent') ; 
  element.html(msg) ;
  //...
}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ziz194