Hi everyone, I have been trying to extract the value of <li>
elements that display images horizontally. Below is the HTML code I am working with:
<div id="layoutInnerOptions">
<ul id="navigationItemsContainer" class="layouts_list">
<li class="layout_container" rel="0" value="temp1">
<img src="resources/Images/layout_bottom2.png" alt="bottom" rel="0" />
</li>
<li class="layout_container" rel="1" value="temp4">
<img src="resources/Images/layout_top2.png" alt="top" rel="1" />
</li>
<li class="layout_container" rel="2" value="temp3">
<img src="resources/Images/layout_menu2.png" alt="menu" rel="2" />
<li class="layout_container" rel="3" value="temp2">
<img src="resources/Images/layout_buttons2.png" alt="buttons" rel="3" />
</li>
</ul>
</div>
I have attempted to use jQuery to retrieve the values like temp1, temp2, etc. from the <li>
elements but have encountered difficulties with the following code snippet:
if (confirm('Are you sure you want to save this thing into the database?')==true) {
var Apptxt = $("#AppNametxt").val();
var Appdesc=$("#txtdesc").val();
var Applayout=$("#navigationItemsContainer").val();
$.post("http://www.domain_name.com/data.php",{Starts:'appcontent', Appdesc:Appdesc, Apptxt:Apptxt, Applayout:Applayout},
function(data) {
$('#message').html("Content Saved");
});
}
I would greatly appreciate any assistance in resolving this issue. Thank you all for your help.