Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
<ul class="isotope items" id="ulList">

                        if (Model != null)
                        {
                            @foreach (var item in Model.Images)
                            {
                                <li class="item">
                                   
                                        <a href="/Home/Album1" id="ancTag">
                                           
                                            
                                                    <h2 class="post-title">Album 1</h2>
                                                    <div class="meta"><span class="count">10 Photos</span></div>
                                              
                                           
                                            <img src="@Url.Content(item)" alt=""  class="imgDynamic"/>
                                        </a>
                                   
                                </li>
                            }
                        }

                    </ul>


What I have tried:

JavaScript
$(".imgDynamic").on('click', function (e) {
    debugger;
    e.preventDefault();
    alert('fsdfsdf');
})
Posted
Updated 16-Mar-17 4:41am
Comments
F-ES Sitecore 16-Mar-17 10:37am    
Read the documentation for on
Bryian Tan 16-Mar-17 12:54pm    
code look OK, any error?
Member 13063459 17-Mar-17 1:32am    
not getting alert message on click event
Karthik_Mahalingam 20-Mar-17 2:59am    
Always use  Reply  button, to post Comments/query to the user, so that the user gets notified and responds to your text.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900