L
Lasse
I have done this simple function, it seems to work as intended, to
solve a problem i have had for a while. I couldnt find any sample
around that was working for me.
I would like to test it with you and see if there are any improvments
that i should make ;-)
It should be fast and if possible compatible with todays modern
browser-standards. It should be activated by the onload-event.
This is my code, free for all to use:
<html><head>
<title>brTest</title>
</head>
<body>
<br>
<div id=mybrid>
<a id=myid1 href="#">Text 1 with<br>a linebreak (<br></a>
<br clear="all">
<a id=myid2 href="#">Text 2 with<br>a linebreak (<br></a>
</div>
<br>
<a id=myid3 href="#">Text 3 with<br>a linebreak (<br> that
should remain as it is.</a>
<br><br>
<SCRIPT LANGUAGE="JavaScript"><!--
function brTest(){
var d=document.getElementById;
d("mybrid").innerHTML=d("mybrid").innerHTML.replace(/<br>/gim," ");
}
//--></SCRIPT>
<form>
<button onclick="brTest();">Call brTest()</button>
</form>
</body>
</html>
solve a problem i have had for a while. I couldnt find any sample
around that was working for me.
I would like to test it with you and see if there are any improvments
that i should make ;-)
It should be fast and if possible compatible with todays modern
browser-standards. It should be activated by the onload-event.
This is my code, free for all to use:
<html><head>
<title>brTest</title>
</head>
<body>
<br>
<div id=mybrid>
<a id=myid1 href="#">Text 1 with<br>a linebreak (<br></a>
<br clear="all">
<a id=myid2 href="#">Text 2 with<br>a linebreak (<br></a>
</div>
<br>
<a id=myid3 href="#">Text 3 with<br>a linebreak (<br> that
should remain as it is.</a>
<br><br>
<SCRIPT LANGUAGE="JavaScript"><!--
function brTest(){
var d=document.getElementById;
d("mybrid").innerHTML=d("mybrid").innerHTML.replace(/<br>/gim," ");
}
//--></SCRIPT>
<form>
<button onclick="brTest();">Call brTest()</button>
</form>
</body>
</html>