getCurrentTermText();
The getCurrentTermText method returns the text of the term that currently has the cursor on it.
The getCurrentTermText method does not return text of the term that has the Term.IsLiteral property set to False.
To execute the example, create the TermEdit component named termEdit.
In the BODY tag add a button named get selected term which, when pressed, performs the getSelectedTerm() function, and a row that should display the output of this function:
<!--Button-->
<input type="button" value="get selected term" onclick="getSelectedTerm();" style="vertical-align: top;" />
<!--Row-->
<span id="selectedTerm"></span>
Add a function to the Javascript code:
function getSelectedTerm() {
document.getElementById("selectedTerm").innerHTML = termEdit.getCurrentTermText();
}
After executing the example, on pressing the get selected term button the page displays the text of the term that currently has the cursor on it.
See also: