How to insert a html code in place of {random} in jquery?

In blogger, when I write a post wherever I write {ad} it automatically insert ad code. My template uses Jquery as main Javascript library. Is there any way that I can define what to come at place of {ad} and wherever I write {ad} for e.g. <div>{ad}</div> it automatically insert my ad code.

Just like in Angular.js