hello, i have a serious problem with people who are not familiar with HTML and do not know how to create a link. i have this script that allows you to write a text, then select it, and push a button to fill in the URL and then the link-code gets filled into people's comments.

PHP Code:
function ahrefThis() {
strSelection document.selection.createRange().text
if (strSelection == ""document.comments.text.focus()
strHref prompt("Enter the URL of the site to link:","http://")
document.selection.createRange().text "<a href=\"" strHref "\" target=\"_blank\" class=\"text\">" strSelection "</a>"
if (strHref == null) return;
return;

but i need a script that creates a link that is named "link" by default, too, like this:

PHP Code:
<a href="URL">link</a
also if no text is selected.
i want to offer both choices:

if text is selected use the selected text as the name of the link.
else use the word "link" to name the link automatically.


i hope that explains it.