-8

How can I change onclick function of bottom code. I mean this monogramposselect('1') function. But not all of it. 1 between quotes. It should be changing on time. When I am writing some text to another text box, The "1" changes with the text. Is it possible?

<input onclick="monogramposselect('1')" type="radio" id="monogramkonumcep" name="monoramkonum" value="cep" />

Please take a look.

http://jsfiddle.net/ayhankerim/aW7H5/

4

2 回答 2

0

在您的声明中,monogramposselect()不要使用参数,而是使用monoramkonum.value.

于 2013-05-06T15:48:04.753 回答
0

也许这可以帮助你,或引导你到其他想法

HTML

<input type="text" id="event_1"/>
<input type="radio" id="event_2" />

Javascript

window.onload = () => {
    const event_1 = document.getElementById("event_1");
    const event_2 = document.getElementById("event_2");
    event_1.addEventListener('input', (evt) => {
        event_2.addEventListener("click", function() {
            // you can use evt to do something, if you want to value, use evt.data
            console.log(evt);
        }, {
            once: true
        });
    });
于 2020-01-14T10:05:02.777 回答