値:i「はJavascriptを - 入力で配列を作成し、私はこのようなのforeach PHP持っ
var inputsArray= [value first input, value second input, value....]
:
@foreach($posts as $post)
<h2>{{$post->title}}</h2>
<img src="{{$post->image}}" width="150" height="150">
<p>{{$post->country}}</p>
<p>{{$post->zone}}</p>
<p>{{$post->user->name}}</p>
<input type="hidden" class="postId" value="{{$post->id}}" name="postId">
<p class="expiredate">{{$post->expire_date}}</p>
<p class="current">{{$current}}</p>
@endforeach
を私はこのような入力hiddensの値を持つJavaScriptの配列を行いたいと思いますメートルこのようtryng:
var d = document;
var inputsArray = d.querySelectorAll('.postId');
が、それは仕事をdoen't、私のコンソールは私を与える:
:配列自体は
value
性質を持っていないようすると、その配列を反復処理しますか? – theonlygustiまた、 'console.log(inputArray)'を試してください – theonlygusti