JS String HTML Wrapper


JS HTML Wrapper functions can wrapper up the string parameters for HTML context. For example, sup("test") will return "<sup>test</sup>".

anchor(...) returns the parameter string as an anchor.

var str = "last:";
str.anchor("anchor1");

The above code will return: <a name="anchor1">last:</a>.

big() adds <big> tag to the string, and the string will be showed in big font.

var str="test";
str.big();

The above code returns "<big>test</big>", will be showed as test.

bold() adds <b> tag to the string, and the string will be showed in bold.

var str="test";
str.b();

The above code returns "<b>test</b>", will be showed as test.

fontcolor(...) adds <font color=...> tag to the string, and the string will be showed in the specified color.

var str="test";
str.fontcolor("green");

The above code returns '<font color=green>test</font>', will be showed as test.

fontsize(...) adds <font size=...> tag to the string, and the string will be showed in the specified size, 1 - 5.

var str="test";
str.fontsize("5");

The above code returns '<font size=5>test</font>', will be showed as test.

italics() adds <i> tag to the string, and the string will be showed in the italic style.

var str="test";
str.italics();

The above code returns '<i>test</i>', will be showed as test.

link(...) turns the string into a hypertext link of the parameter.

var str="BMI Calculator";
str.link("http://www.endmemo.com/medical/bmi.php");

The above code returns '<a href="http://www.endmemo.com/medical/bmi.php">BMI Calculator</a>', and will be showed as BMI Calculator.

small() adds <small> tag to the string, and the string will be showed in small font.

var str="test";
str.small();

The above code returns "<small>test</small>", will be showed as test.

strike() adds <strike> tag to the string, and the string will be striked through.

var str="test";
str.strike();

The above code returns "<strike>test</strike>", will be showed as test.

sub() adds <sub> tag to the string, and the string will be showed as a subscript.

var str="test";
str.sub();

The above code returns "<sub>test</sub>", will be showed as test.

sup() adds <sup> tag to the string, and the string will be showed as a superscript.

var str="test";
str.sup();

The above code returns "<sup>test</sup>", will be showed as test.


endmemo.com © 2024  | Terms of Use | Privacy | Home