I have the following code which works to a degree with text开发者_开发技巧 fields but not textareas
javascript:(function(){for(var%20text=prompt('enter%20text%20to%20fill')||'',ins=document.getElementsByTagName('input'),it,m=ins.length,i=0;i<m;i++){it=ins[i];if(it.name=='text')it.value=text;};}());
Thanks for any help.
A simplified example, based on your bookmarklet:
Readable version:
(function(){
  var t = prompt('enter text to fill') || '',
  ta = document.getElementsByTagName('textarea'), n = ta.length;
  while(n--){
    ta[n].value = t;
  }
}());
Bookmarklet:
javascript:(function(){var%20t=prompt('enter%20text%20to%20fill')||'',ta=document.getElementsByTagName('textarea'),n=ta.length;while(n--){ta[n].value=t;}}());
Change:
ins=document.getElementsByTagName('input')
to
ins=document.getElementsByTagName('textarea')
and remove
if(it.name=='text')
Note: this will insert your text into all textareas in the document
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论