function doImage() { var imgSrc = prompt('Enter image location', ''); if(imgSrc != null) iView.document.execCommand('insertimage', false, imgSrc); } function doRule() { iView.document.execCommand('inserthorizontalrule', false, null); }