Link to home
Start Free TrialLog in
Avatar of codelevel
codelevel

asked on

declaring variable

how to declare multiple variables without redundancy?
for example there are multiple <p> tags with ids in a page.
how to dynamically create unique variables on the fly looping through the page?

<script type='text/javascript'>//<![CDATA[
$(function() {
    var text = $('#first').text();  
    var text = $('#second').text();  
    var text = $('#third').text();  
});
//]]>  

</script>
ASKER CERTIFIED SOLUTION
Avatar of Hammadh Abdul Rahman
Hammadh Abdul Rahman
Flag of Maldives image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial