开发者

Click a link to display a value

开发者 https://www.devze.com 2023-01-02 10:41 出处:网络
I have a shoutbox/ chatroom feature on my site. I ha开发者_如何学Pythonve a list of online users on the left.

I have a shoutbox/ chatroom feature on my site. I ha开发者_如何学Pythonve a list of online users on the left. I plan on making a button for each user that when clicked, puts their username into the typing area on the shoutbox.

Whats the best way to go about doing this?


You want it so when you click their name, it's appended to a text field? You can just do:

<span onClick="document.getElementById('shoutbox').text += 'test-username';">test-username</span>


Bind the links to JavaScript. PHP can't help you here.

0

精彩评论

暂无评论...
验证码 换一张
取 消