Forum Moderators: open
Is there an easy way to create str3 which is str2 except for the contents of str1? IE:
var str3 = some_neat_function(str1, str2);
Output:
'some in here'.
I need something like this to dynamically add and remove class names from elements on given events (such as onmouseover and onmouseout in tables to highlight complete rows/columns)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
var str1 = 'text ';
var str2 = 'some text in here';
var sub_strs=str2.split(str1);
alert(sub_strs[0]+sub_strs[1]);
</script>
</head>
<body>
</body>
</html>