I\'d like to update element\'s text dynamically:
**text to change**
text t
This is an old question but you can make a simple function like this to make your life easier:
$.fn.toText = function(str) {
var cache = this.children();
this.text(str).append(cache);
}
Example:
**text to change**
text that should not change
text that should not change
Usage:
$("#my-div").toText("helloworld");