JavaScript DHTML/Javascript Objects/String

Материал из Web эксперт
Версия от 07:23, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

String.big()

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>



String.blink()

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>



String.bold()

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>



String.concat()

  
<html>
<head>
<title>Exploring String</title>
</head>
<body>
<script type="text/javascript">
var sObj = new String();
var sTxt = sObj.concat("This is a ", "new string");
document.writeln(sTxt);
</script>
</body>
</html>



"String" Example

 
    
<html>
<body>
<div id="myDiv" style="width:100; height:100;">This is some sample text</div>
<script language="javascript">
function function1(){
    var temp = new String(); temp = myDiv.innerText; alert(temp); 
} 
</script>
<button onclick="function1();">String function</button>
</body>
</html>



String.italics()

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>



String.link()

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>



String.small()

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>



String.strike()

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>



String.sup();

  
<html>
<head>
<title>String formatting methods</title>
</head>
<body>
<script type="text/javascript">
var someString = new String("This is the test string");
document.writeln(someString.big());
document.writeln(someString.blink());
document.writeln(someString.sup());
document.writeln(someString.strike());
document.writeln(someString.bold());
document.writeln(someString.italics());
document.writeln(someString.small());
document.writeln(someString.link("http://www.wbex.ru"));
</script>
</body>
</html>