JSFiddle - React, Tailwind, and code Playground

HTML

<ul>
    
    <li id="li_123" >
        
        <input type="text" id="photoname" class="photoname" name="photoname" value="someimage" />
        
        <textarea id="comment">some comment</textarea>
        
        <a href="#" class="save" >Save 123</a>
        
    </li>
</ul>

JavaScript

$('li .save').click(function(event) {
    event.preventDefault()
    var id = $(this).parent().attr('id');
    var photo = $(this).closest('li').find('#photoname').val();
    var comment = $(this).closest('li').find('#comment').val();
    var info = {
        id: id,
        photo: photo,
        comment: comment
    }
    alert(info.toSource());
});