Question: I've a div

```
@{int index = 0;}
@for (int i = 0; i < Model.lstFiles.Count; i++)
{
     <div id="attachmentDetail(@index)" name="attachmentDetail(@index)" class="panel-body">
         <a asp-action="Download" asp-controller="Admin" asp-route-realName=Model.lstFiles[i].RealName>@Model.lstFiles[i].FileName</a>
         <a onclick="btnDelFile_Click(@index)" id="btnDelFile{@index}" class="pull-right" title="delete"><img height="20" width="20" src="@Url.Content("~/images/delete.jpg")" /></a>
         <input type="text" asp-for="@Model.lstFiles[i].IsDeleted" hidden />
         <input type="text" asp-for="@Model.lstFiles[i].FileId" hidden />
         <hr />
     </div>
     index++;
 }

```

I want to update `@Model.lstFiles[i].IsDeleted` value on `btnDelFile_Click`. But I'm unable to get div and its child. I tried this code

```
$('#attachmentDetail(' + index +') :input lstFiles['+index+'].IsDeleted').val("True");

```

but it says

> 
> jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: #attachmentDetail(0)
> 
> 
> 

Is there any better way to get child of div?? I want to update `IsDeleted` value, and then hide this div. 

Any kind of help will be appreciated.

Answer: 
> 
> how i can get this selected image path
> 
> 
> 

For what feels like the 3,735th time, there is no "selected image path". You are getting a `Uri` back (`data.getData()`); a `Uri` does not have to point to a file. For example, `http://stackoverflow.com/questions/44057912/not-getting-correct-path-when-select-image-from-gallery` is a `Uri`; it does not represent a file on the filesystem.

If you want a file, use [a file-picker library](https://android-arsenal.com/tag/35?sort=created).
At last, I decided to do the same procedure what I did in Method "onCaptureImageResult(Intent data)". The image I get from the Gallery stored again to a directory.I know this is absolutely not the good procedure, but it solved my problem temporally until I get a good answer.

```
@SuppressWarnings("deprecation")
private void onSelectFromGalleryResult(Intent data) {

    Bitmap bm=null;
    if (data != null) {
        try {
            bm = MediaStore.Images.Media.getBitmap(getApplicationContext().getContentResolver(), data.getData());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    bm.compress(Bitmap.CompressFormat.JPEG, 90, bytes);

    File destination = new File(Environment.getExternalStorageDirectory(), System.currentTimeMillis() + ".jpg");

    FileOutputStream fo;
    try {
        destination.createNewFile();
        fo = new FileOutputStream(destination);
        fo.write(bytes.toByteArray());
        fo.close();
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    Bitmap bm1 = BitmapFactory.decodeFile(destination.getAbsolutePath());
    ivImage.setImageBitmap(bm1);
    String selectedImageUri = data.getData().getPath();
    showImagepathET.setText(destination.getAbsolutePath());

}

```