Component allow for insertion of arbitrary HTML into an entity
public this .replace(String html)
This method will replace the content of this entity with the supplied html
Create a link
Crafty.e("HTML")
.attr({x:20, y:20, w:100, h:100})
.replace("<a href='http://www.craftyjs.com'>Crafty.js</a>");
public this .append(String html)
This method will add the supplied html in the end of the entity
Create a link
Crafty.e("HTML")
.attr({x:20, y:20, w:100, h:100})
.append("<a href='http://www.craftyjs.com'>Crafty.js</a>");
public this .prepend(String html)
This method will add the supplied html in the beginning of the entity
Create a link
Crafty.e("HTML")
.attr({x:20, y:20, w:100, h:100})
.prepend("<a href='http://www.craftyjs.com'>Crafty.js</a>");