Webbrowser padding textarea

Source: Internet
Author: User

I am using the webbrowser control to create an automatic filling program. Automatic Filling is simple. The page is composed of text elements, several single-choice items, and so on. You can get the set value, but at last I encountered a very tricky problem, that is, there is a text editing area of textarea. This editing area is similar to the QQ space and other editing areas used to write logs, but it only has fewer editing functions than them. At first, I thought it was just a textarea. I had done it before. It was easy to set its innertext attribute, but it was not as good as I thought, I set his innertext to no effect. Didn't I get this textarea, so I added a null judgment, and the result still failed. Later, I tried a variety of methods to set its value, text, find its Div to set the innerhtml attribute, and reset the HTML source code for webbrowser. I suspect that I want to execute a JS function, just stare at the source code of the page and look for JS functions. After finding them, find two JS functions that look at textarea. Then, add the JS function in the program and pass the parameters, the result is still disappointing. textarea is still empty. Then I thought about what kind of events would trigger textarea, and I couldn't ask for Google's help. gg gave me a detailed look at textarea and saw all his behaviors, methods, events, and attributes, I tried a lot and the result was still disappointing. Why can't I fill it. I accidentally clicked on the editing area to view the source code. As a result, it was not the source code of the entire page. It was just an empty page with nothing in it, the code for the page is as follows:

<! Doctype> <HTML>

I want to use the framework in it? Then I went to the source code of the entire page to search for IFRAME frameset and didn't find any frameworks. Well, if you don't care, try writing programs in a framework. So I added this code to the program:
This.webbrowser1.document.w.frames%0}.doc ument. getelementbyid ("tinymce"). innertext = "My content ";

Then let me debug it once. Haha, it was unexpected and the result came out. This problem is so tangled. It took me a whole day. Finally, I was in a good mood. Haha. By the way, the ID in the above Code getelementbyid is not the ID of textarea but the ID of the empty page body. Figure with textarea:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.