Recently made an HTML to PDF project, the middle of the user interactive HTML, and the interactive HTML results converted to PDF, but the first encounter a problem,
That is, whether it is the Val () or the DOM of jquery. Value is always unable to assign a value to the page's document (that is, the console's HTML code) just on the surface.
The DOM in the original browser is divided into attributes and attributes, which refers to the properties of the DOM object in the current browser, which refers to a plain HTML document,
I want to take HTML, of course, to change the text of the HTML document, and not just to let the user see the properties, generally do not have to HTML when the difference between the two.
And, after the page has been generated by the browser, from the perspective of value, these two are basically unrelated, you change that side, the other side is unchanged. What other style?
The property says otherwise. In summary, if you want to change the DOM object and HTML document, if using jquery must be Val () and attr () a piece, if the change is pure JS
, JS's Dom object has a attributes feature, in which the face changes to modify the HTML document.
Use pure JS for an example
If you only assign a value to a DOM object's properties Obj.value then the textbox's surface values and DOM object properties are changed, but the HTML document does not change
Only attributes-assigned HTML documents will change
The JQ is not written, it's a attr and Val.
DOM Properties and attributes