简体   繁体   中英

save html color table in mysql

I am making a website where users can post quilting patterns on a standard HTML table. I created a table where users can click to change the color of a cell of an HTML table, but the changes don't last. Thus, I want to save the entire HTML table to a SQL database. I looked up other posts on saving HTML tables, but they all deal with values (and changing them). I have no values. All I want to do is to save the colors.

Their is a javascript function to get attribute of any html tags Here u need to use the function to get the color attribute of the respective table and store it in a variable which later can be inserted into database using php function.

ex: var x = document.getElementsByTagName("H1")[0].getAttribute("class");

reference link: https://www.w3schools.com/jsref/met_element_getattribute.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM