38
rated 0 times
[
45]
[
7]
/ answers: 1 / hits: 27341
/ 14 Years ago, tue, february 8, 2011, 12:00:00
In HTML, I have a button list. If user clicks a button,
doCommand
function will be called.
The code is following,
<ul>
<li class=button1 onclick=doCommand('bold'); id=bold-button title=bold>B</li>
<li class=button2 onclick=doCommand('bold'); id=italic-button title=bold>I</li>
<li class=button3 onclick=doCommand('bold'); id=underline-button title=bold>U</li>
<li class=button4 onclick=doCommand('bold'); id=strikethrough-button title=bold>S</li>
</ul>
This is plain expression, normal web programmer will code like that.
But, I want to hide onclick
event and its function for security reason.
So the HTML code will be like this,
<ul>
<li class=button1 id=bold-button title=bold>B</li>
<li class=button2 id=italic-button title=bold>I</li>
<li class=button3 id=underline-button title=bold>U</li>
<li class=button4 id=strikethrough-button title=bold>S</li>
</ul>
Is there any efficient way to do this?
Hiding onclick
property but do the same work.
I am using jQuery.
More From » jquery