The first hint Bobafart gave was to use something like:
document.getElementById('edit').innerHTML="This is the <span style='color:red;'>new</span> text.";
As you can see, innerHTML is all of the html inside of the <div> element. Thus you can add other html elements (like my <span>) inside this string. The only problem (sort-of) is that innerHTML is not compliant with the W3C standards. The W3C consortium is a group that is trying to standardize web languages. Since innerHTML is not (currently) compliant, the script may fall apart in the future if future browsers decide to become completely compliant. However, all major browsers to date recognize innerHTML (eg IE, Firefox, Netscape, etc...) so it may be a moot point to worry about this. There are other compliant DOM methods for achieving the same result (search out a good DOM tutorial to learn about these), but innerHTML is easier, faster (according to quirksmode), and does not fall prey to the "hidden text-node" that affects some browsers but not others.
I believe that Bobafart's other hint was to find a .js library on the web that already contains many useful AJAX functions. Since I haven't seen these, I can only assume that there is a function that you would provide an id for the div you want changed, a file on the server that the AJAX calls, and perhaps other parameters; and the function will then make the AJAX call and change the innerHTML of the provided div. I guess it depends more on your own curiosity and desire to learn. If you want some quick AJAX code to stick into some project you are working on, then getting one of these libraries may be the way to go. If you are using AJAX scripts to learn more about this technique, then writing these sample scripts and really understanding how everything works will probably serve you better.
If you want answers, write a smart question
, someone probably does know how...
Oh, and if you want to learn, STFW