XML:
<CONTROLS>
<BUTTON>
<input name="myButton" onclick="existingFunction();"/>
</BUTTON>
<LABEL>
Text ME
</LABEL>
</CONTROLS>
XSLT:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="input">
<input onclick="{@onclick}newFunction();">
<xsl:copy-of select="@*[not(name()='onclick')]"/>
</input>
</xsl:template>
</xsl:stylesheet>
1 つの onclick 属性に 2 つの関数を入れるにはどうすればよいですか?
結果:
<input onclick="existingFunction();newFunction();" name="myButton"/>
動いていない。この2つの機能をマージする他の方法はありますか??
関数 2 を関数 1 の中に入れたくありません。:)